Пример #1
0
def start(apptype, exec_dir):
    appname = "freestream"
    single_instance_checker = wx.SingleInstanceChecker(appname + '-' + wx.GetUserId())
    if single_instance_checker.IsAnotherRunning():
        print >> sys.stderr, 'appwrapper: already running, exit'
        if get_default_api_version(apptype, exec_dir) < 2:
            send_startup_event()
        os._exit(0)
    globalConfig.set_value('apptype', apptype)
    globalConfig.set_mode('client_wx')
    wrapper = AppWrapper()
    try:
        bgapp = run_bgapp(wrapper, appname, VERSION)
    except Exception as e:
        print >> sys.stderr, 'Fatal error while starting:', str(e)
        print_exc()
        os._exit(0)

    wrapper.set_bgapp(bgapp)
    bgapp.debug_systray = bgapp.debug_level & 1024 != 0
    freestream.Player.systray.DEBUG = bgapp.debug_systray
    freestream.Player.systray.SHOW_DEBUG_LEVEL = bgapp.debug_systray
    freestream.Player.systray.DEBUG_PIECES = bgapp.debug_level & 128 != 0
    freestream.Player.systray.DEBUG_VIDEOSTATUS = bgapp.debug_level & 2048 != 0
    freestream.Player.systray.DEBUG_PROXY_BUF = bgapp.debug_level & 4096 != 0
    wrapper.MainLoop()
    if not ALLOW_MULTIPLE:
        del single_instance_checker
    stop_bgapp(bgapp)
Пример #2
0
def start(apptype, exec_dir):
    globalConfig.set_value('apptype', apptype)
    appname = "freestream"
    globalConfig.set_mode('client_console')
    wrapper = AppWrapper()
    bgapp = run_bgapp(wrapper, appname, VERSION)
    wrapper.set_bgapp(bgapp)
    wrapper.MainLoop()
    stop_bgapp(bgapp)