接着之前探索odoo后台启动的过程,上次讲到是进入了server.py ,那么就查看server.py的源代码,其结构大致如下:
def ..
.
.
.
#若干函数
class Server(Command):
"""Start the odoo server (default command)"""
def run(self, args):
main(args)
也就是command.py中的最后几行代码
if command in commands:
o = commands[command]()
o.run(args)
将命令行参数换入server中的参数args,调用Server类的run方法,看到在server.py中定义的main(args)函数:
def main(args):
check_root_user