• odoo.cli.main()指的是哪里?OpenERP的第二根线头儿


    接上回,odoo-bin中调用了odoo.cli.main(),去哪儿找?

    cli目录容易找

    跟随__init__.py的脚步

     1 import logging
     2 import sys
     3 import os
     4 
     5 import odoo
     6 
     7 from command import Command, main
     8 
     9 import deploy
    10 import scaffold
    11 import server
    12 import shell
    13 import start

    see line 7

    我们发现程序从command中引入了command类?和main函数

    then goto command.py

    搜索 main()

    我们发现

     1         print "
    Use '%s <command> --help' for individual command help." % sys.argv[0].split(os.path.sep)[-1]
     2 
     3 def main():
     4     args = sys.argv[1:]
     5 
     6     # The only shared option is '--addons-path=' needed to discover additional
     7     # commands from modules
     8     if len(args) > 1 and args[0].startswith('--addons-path=') and not args[1].startswith("-"):
     9         # parse only the addons-path, do not setup the logger...
    10         odoo.tools.config._parse_config([args[0]])
    11         args = args[1:]
    12 
    13     # Default legacy command
    14     command = "server"

    我想就是这里了

    TODO:main()做了什么?

  • 相关阅读:
    翻译一下libtiff的手册
    LIBTIFF读写黑白TIFF
    LIBTIFF存储代码,存图、拼图
    几点TIFF的说明
    TIFF Tag TileWidth
    TIFF Tag Orientation
    OpenCV 加速图像处理
    Qt QString 、String、char* 三者之间相互转换
    PackBits解压缩算法
    关于LZW算法的压缩与解压缩
  • 原文地址:https://www.cnblogs.com/qianheng/p/6240739.html
Copyright © 2020-2023  润新知