zoukankan      html  css  js  c++  java
  • 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()做了什么?

  • 相关阅读:
    es6作用域
    es6函数的扩展
    input输入框ios上光标与placeholder、value不能对齐居中
    移动端input常用样式
    webpack安装遇到的坑
    错误类型
    滚动超出一定高度后,导航栏吸顶
    表单change()事件
    第二周学习进度
    第一周学习进度
  • 原文地址:https://www.cnblogs.com/qianheng/p/6240739.html
Copyright © 2011-2022 走看看