Пример #1
0
def main():
    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    launcher_log.info("start XX-Net %s", update_from_github.current_version())

    web_control.confirm_xxnet_exit()

    setup_win_python.check_setup()

    module_init.start_all_auto()

    web_control.start()


    if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1:
        host_port = config.get(["modules", "launcher", "control_port"], 8085)
        webbrowser.open("http://127.0.0.1:%s/" % host_port)

    update.start()

    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(100)

    module_init.stop_all()
    sys.exit()
Пример #2
0
def main():

    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    web_control.confirm_xxnet_exit()

    setup_win_python.check_setup()

    module_init.start_all_auto()

    web_control.start()

    #config.load()
    if config.get(["modules", "launcher", "popup_webui"], 1) == 1:
        webbrowser.open("http://127.0.0.1:8085/")

    update.start()

    sys_tray.serve_forever()

    module_init.stop_all()
    sys.exit()
Пример #3
0
def main():

    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, "readlink", lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    web_control.confirm_xxnet_exit()

    setup_win_python.check_setup()

    module_init.start_all_auto()

    web_control.start()

    if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1:
        webbrowser.open("http://127.0.0.1:8085/")

    update.start()

    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(100)

    module_init.stop_all()
    sys.exit()
Пример #4
0
def main():

    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    web_control.confirm_xxnet_exit()

    setup_win_python.check_setup()

    module_init.start_all_auto()

    web_control.start()


    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(100)

    module_init.stop_all()
    sys.exit()
Пример #5
0
def main():
    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    if sys.platform == "win32" and config.get(["show_compat_suggest"], 1):
        import win_compat_suggest
        win_compat_suggest.main()

    current_version = update_from_github.current_version()

    xlog.info("start XX-Net %s", current_version)

    web_control.confirm_xxnet_not_running()

    setup_win_python.check_setup()

    import post_update
    post_update.check()

    allow_remote = 0
    if len(sys.argv) > 1:
        for s in sys.argv[1:]:
            xlog.info("command args:%s", s)
            if s == "-allow_remote":
                allow_remote = 1
                module_init.xargs["allow_remote"] = 1

    if os.path.isfile(running_file):
        restart_from_except = True
    else:
        restart_from_except = False

    module_init.start_all_auto()
    web_control.start(allow_remote)

    if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1 and not restart_from_except:
        host_port = config.get(["modules", "launcher", "control_port"], 8085)
        import webbrowser
        webbrowser.open("http://localhost:%s/" % host_port)

    if has_desktop :
    	import webbrowser
    	webbrowser.open("https://www.bannedbook.org/bnews/fq/?utm_source=XX-Net")

    update.start()
    download_modules.start_download()
    update_from_github.cleanup()

    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(1)
Пример #6
0
def main():
    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    current_version = update_from_github.current_version()

    xlog.info("start XX-Net %s", current_version)

    web_control.confirm_xxnet_exit()

    setup_win_python.check_setup()

    last_run_version = config.get(["modules", "launcher", "last_run_version"],
                                  "0.0.0")
    if last_run_version != current_version:
        import post_update
        post_update.run(last_run_version)
        config.set(["modules", "launcher", "last_run_version"],
                   current_version)
        config.save()

    allow_remote = 0
    if len(sys.argv) > 1:
        for s in sys.argv[1:]:
            xlog.info("command args:%s", s)
            if s == "-allow_remote":
                allow_remote = 1
                module_init.xargs["allow_remote"] = 1

    module_init.start_all_auto()
    web_control.start(allow_remote)

    if has_desktop and config.get(["modules", "launcher", "popup_webui"],
                                  1) == 1:
        host_port = config.get(["modules", "launcher", "control_port"], 8085)
        import webbrowser
        webbrowser.open("http://127.0.0.1:%s/" % host_port)

    update.start()

    update_from_github.delete_to_save_disk()

    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(100)

    module_init.stop_all()
    sys.exit()
Пример #7
0
def main():
    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    current_version = update_from_github.current_version()

    xlog.info("start XX-Net %s", current_version)

    web_control.confirm_xxnet_exit()

    setup_win_python.check_setup()

    last_run_version = config.get(["modules", "launcher", "last_run_version"], "0.0.0")
    if last_run_version != current_version:
        import post_update
        post_update.run(last_run_version)
        config.set(["modules", "launcher", "last_run_version"], current_version)
        config.save()

    allow_remote = 0
    if len(sys.argv) > 1:
        for s in sys.argv[1:]:
            xlog.info("command args:%s", s)
            if s == "-allow_remote":
                allow_remote = 1
                module_init.xargs["allow_remote"] = 1

    module_init.start_all_auto()
    web_control.start(allow_remote)

    if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1:
        host_port = config.get(["modules", "launcher", "control_port"], 8085)
        import webbrowser
        webbrowser.open("http://127.0.0.1:%s/" % host_port)

    update.start()

    update_from_github.delete_to_save_disk()
    
    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(100)

    module_init.stop_all()
    sys.exit()
Пример #8
0
def main():
    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    if sys.platform == "win32" and config.get(["show_compat_suggest"], 1):
        import win_compat_suggest
        win_compat_suggest.main()

    current_version = update_from_github.current_version()

    xlog.info("start XX-Net %s", current_version)

    web_control.confirm_xxnet_not_running()

    setup_win_python.check_setup()

    import post_update
    post_update.check()

    allow_remote = 0
    if len(sys.argv) > 1:
        for s in sys.argv[1:]:
            xlog.info("command args:%s", s)
            if s == "-allow_remote":
                allow_remote = 1
                module_init.xargs["allow_remote"] = 1

    module_init.start_all_auto()
    web_control.start(allow_remote)

    if has_desktop and config.get(["modules", "launcher", "popup_webui"], 1) == 1:
        host_port = config.get(["modules", "launcher", "control_port"], 8085)
        import webbrowser
        webbrowser.open("http://localhost:%s/" % host_port)

    update.start()

    update_from_github.cleanup()

    if config.get(["modules", "launcher", "show_systray"], 1):
        sys_tray.serve_forever()
    else:
        while True:
            time.sleep(1)
Пример #9
0
def main():
    # change path to launcher
    global __file__
    __file__ = os.path.abspath(__file__)
    if os.path.islink(__file__):
        __file__ = getattr(os, 'readlink', lambda x: x)(__file__)
    os.chdir(os.path.dirname(os.path.abspath(__file__)))

    current_version = update_from_github.current_version()

    xlog.info("start XX-Net %s", current_version)

    web_control.confirm_xxnet_not_running()

    setup_win_python.check_setup()

    import post_update
    post_update.check()

    allow_remote = 0
    if len(sys.argv) > 1:
        for s in sys.argv[1:]:
            xlog.info("command args:%s", s)
            if s == "-allow_remote":
                allow_remote = 1
                module_init.xargs["allow_remote"] = 1

    module_init.start_all_auto()
    web_control.start(allow_remote)

    if has_desktop and config.get(["modules", "launcher", "popup_webui"],
                                  1) == 1:
        host_port = config.get(["modules", "launcher", "control_port"], 8085)
        import webbrowser
        webbrowser.open("http://localhost:%s/" % host_port)

    update.start()

    update_from_github.cleanup()

    if config.get(["modules", "launcher", "show_systray"], 1):
        threading.Thread(target=sys_tray.serve_forever).start()

    while True:
        time.sleep(1)