Example #1
0
def main():
    global TOOLS_OPTIONS
    config = Config.load_by_name(TOOLS_OPTIONS.config)
    _add_python_path(config)
    workflow_module = _load_module()

    workflow_parser = getattr(workflow_module, "cmd_parser", None)

    # 展示工作流模块所需要的参数说明
    if TOOLS_OPTIONS.show_args:
        _show_args(workflow_parser)

    # 解析workflow所需参数
    workflow_options = None
    if workflow_parser is not None:
        workflow_options = workflow_parser.parse_known_args(sys.argv[1:])[0]

    # 获取当前运行环境
    current_env = _get_current_env(workflow_module)

    # 更新配置信息,使用模块的配置项覆盖配置文件中的配置项
    _update_config(config, current_env, workflow_module, workflow_options)

    # 保存pid到文件
    if TOOLS_OPTIONS.pid:
        _save_pid_file(TOOLS_OPTIONS.pid)

    # 执行工作流
    _execute_workflow(config, workflow_module, workflow_options, current_env)
Example #2
0
def main():
    global TOOLS_OPTIONS
    config = Config.load_by_name(TOOLS_OPTIONS.config)
    _add_python_path(config)
    workflow_module = _load_module()

    workflow_parser = getattr(workflow_module, "cmd_parser", None)

    # 展示工作流模块所需要的参数说明
    if TOOLS_OPTIONS.show_args:
        _show_args(workflow_parser)

    # 解析workflow所需参数
    workflow_options = None
    if workflow_parser is not None:
        workflow_options = workflow_parser.parse_known_args(sys.argv[1:])[0]

    # 获取当前运行环境
    current_env = _get_current_env(workflow_module)

    # 更新配置信息,使用模块的配置项覆盖配置文件中的配置项
    _update_config(config, current_env, workflow_module, workflow_options)

    # 保存pid到文件
    if TOOLS_OPTIONS.pid:
        _save_pid_file(TOOLS_OPTIONS.pid)

    # 执行工作流
    _execute_workflow(config, workflow_module, workflow_options, current_env)
Example #3
0
 def setUp(self):
     self.config = Config.load_by_name("default")
Example #4
0
 def setUp(self):
     self.config = Config.load_by_name("default")