当前位置: 首页>>代码示例>>Python>>正文


Python web_control.stop函数代码示例

本文整理汇总了Python中web_control.stop函数的典型用法代码示例。如果您正苦于以下问题:Python stop函数的具体用法?Python stop怎么用?Python stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了stop函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: restart_xxnet

def restart_xxnet(version):
    import module_init
    module_init.stop_all()
    import web_control
    web_control.stop()

    start_script = os.path.join(top_path, "code", version, "launcher", "start.py")

    subprocess.Popen([sys.executable, start_script])
    time.sleep(20)
开发者ID:JingLuo2017,项目名称:XX-Net,代码行数:10,代码来源:update_from_github.py

示例2: restart_xxnet

def restart_xxnet():
    import module_init
    module_init.stop_all()
    import web_control
    web_control.stop()

    current_path = os.path.dirname(os.path.abspath(__file__))
    start_sript = os.path.abspath( os.path.join(current_path, os.pardir, "start.py"))

    subprocess.Popen([sys.executable, start_sript], shell=False)
开发者ID:juzisan,项目名称:XX-Net,代码行数:10,代码来源:update_from_github.py

示例3: restart_xxnet

def restart_xxnet():
    import module_init
    module_init.stop_all()
    import web_control
    web_control.stop()

    current_path = os.path.dirname(os.path.abspath(__file__))
    start_script = os.path.join(current_path, "start.py")

    subprocess.Popen([sys.executable, start_script])
    time.sleep(10)
    os._exit(0)
开发者ID:03013405yujiangfeng,项目名称:XX-Net,代码行数:12,代码来源:update_from_github.py

示例4: install_module

def install_module(module, new_version):
    import module_init
    import os, subprocess, sys

    current_path = os.path.dirname(os.path.abspath(__file__))
    new_module_version_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir, module, new_version))

    #check path exist
    if not os.path.isdir(new_module_version_path):
        logging.error("install module %s dir %s not exist", module, new_module_version_path)
        return

    #call setup.py
    setup_script = os.path.join(new_module_version_path, "setup.py")
    if not os.path.isfile(setup_script):
        logging.warn("update %s fail. setup script %s not exist", module, setup_script)
        return


    config.set(["modules", module, "current_version"], str(new_version))
    config.save()

    if module == "launcher":
        module_init.stop_all()
        import web_control
        web_control.stop()


        subprocess.Popen([sys.executable, setup_script], shell=False)

        os._exit(0)

    else:
        logging.info("Setup %s version %s ...", module, new_version)
        try:
            module_init.stop(module)

            subprocess.call([sys.executable, setup_script], shell=False)
            logging.info("Finished new version setup.")

            logging.info("Restarting new version ...")
            module_init.start(module)
        except Exception as e:
            logging.error("install module %s %s fail:%s", module, new_version, e)
开发者ID:ChardRapid,项目名称:XX-Net,代码行数:44,代码来源:update.py

示例5: restart_xxnet

def restart_xxnet(version=None):
    import module_init
    module_init.stop_all()

    import web_control
    web_control.stop()
    # New process will hold the listen port
    # We should close all listen port before create new process
    xlog.info("Close web control port.")

    if version is None:
        current_version_file = os.path.join(top_path, "code", "version.txt")
        with open(current_version_file, "r") as fd:
            version = fd.read()

    xlog.info("restart to xx-net version:%s", version)

    start_script = os.path.join(top_path, "code", version, "launcher", "start.py")
    subprocess.Popen([sys.executable, start_script])
    time.sleep(20)

    xlog.info("Exit old process...")
    os._exit(0)
开发者ID:CyrusYzGTt,项目名称:XX-Net,代码行数:23,代码来源:update_from_github.py

示例6: exit_handler

def exit_handler():
    print('Stopping all modules before exit!')
    module_init.stop_all()
    web_control.stop()
开发者ID:DMJackZ,项目名称:XX-Net,代码行数:4,代码来源:start.py


注:本文中的web_control.stop函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。