Python load_entry_point 简述
来源:互联网 发布:手机淘宝的试用在哪里 编辑:程序博客网 时间:2024/06/05 03:04
fab是个python语言写的部署工具
cat /usr/bin/fab #!/usr/bin/python# EASY-INSTALL-ENTRY-SCRIPT: 'Fabric==1.7.5','console_scripts','fab'__requires__ = 'Fabric==1.7.5'import sysfrom pkg_resources import load_entry_pointif __name__ == '__main__': sys.exit( load_entry_point('Fabric==1.7.5', 'console_scripts', 'fab')() )
其中load_entry_point的用法前提是,fab工具在安装的时候会在*..egg-info文件夹下面的entry_points.txt文件中有相应程序的入口点。
/usr/lib/python2.7/site-packages/Fabric-1.7.5-py2.7.egg-info/entry_points.txt
[console_scripts]fab = fabric.main:main
也就是在fabric module的main.py里面的main函数
/usr/lib/python2.7/site-packages/fabric/main.py
"""This module contains Fab's `main` method plus related subroutines.`main` is executed as the command line ``fab`` program and takes care ofparsing options and commands, loading the user settings file, loading afabfile, and executing the commands given.The other callables defined in this module are internal only. Anything usefulto individuals leveraging Fabric as a library, should be kept elsewhere."""def main(fabfile_locations=None): """ Main command-line execution loop. """ try: # Parse command line options parser, options, arguments = parse_options() # Handle regular args vs -- args arguments = parser.largs remainder_arguments = parser.rargs ...
阅读全文
0 0
- Python load_entry_point 简述
- python socket简述
- 简述Python爬虫
- python正则表达式简述
- Python 内置类型简述
- python assert简述
- Python-Matplotlib安装过程简述
- 简述Python isinstance 和type
- Python:线程与GIL简述
- Python爬虫简述系列之一
- 从Fabric谈到dist-packages、site-packages和load_entry_point
- python re 模块 findall 函数用法简述
- LUA、python、注册表和正则表达式简述
- Python字典增删操作技巧简述
- Python字典增删操作技巧简述
- python re 模块 findall 函数用法简述
- python re 模块 findall 函数用法简述
- python re 模块 findall 函数用法简述
- Docker与Kubernetes系列(一): Docker的基本概念
- 常量池(constant_pool)
- JS 17-6-22
- 零配置-----6、MyBatisConfig
- jdk-ThreadPoolExecutor(一)---基本变量和大致流程解析
- Python load_entry_point 简述
- DOM文档加载的步骤
- 自省
- KEIL DEBUG调试记录
- MFC中窗口刷新函数详解
- C# 操作Excel大全
- 链表-leetcode 203. Remove Linked List Elements
- Linux下使Shell 命令脱离终端在后台运行
- maven工程连同所依赖的jar包一起打war包