コード例 #1
0
ファイル: chat.py プロジェクト: llusaq/kukuchat
    async def connect(self):
        await self.accept()

        self.facebook = facebook.FacebookProvider(self.scope,
                                                  self.on_message_consumer)
        self.skype = skype.SkypeProvider(self.scope, self.on_message_consumer)
        self.telegram = telegram.TelegramProvider(self.scope)

        self.scheduler = scheduler.Scheduler(self)
コード例 #2
0
ファイル: watcher.py プロジェクト: piratesam/watcher
    # if everything goes well so far, open the browser
    if passed_args.browser or core.CONFIG['Server']['launchbrowser'] == 'true':
        webbrowser.open("http://{}:{}{}".format(
            core.SERVER_ADDRESS, core.SERVER_PORT, core.URL_BASE))
        logging.info('Launching web browser.')

    # daemonize in *nix if desired
    if passed_args.daemon and os.name == 'posix':
        Daemonizer(cherrypy.engine).subscribe()

    # start engine
    cherrypy.engine.signals.subscribe()
    cherrypy.engine.start()

    # Create plugin instances and subscribe
    scheduler_plugin = scheduler.Scheduler()
    scheduler.AutoSearch.create()
    scheduler.AutoUpdateCheck.create()
    scheduler.AutoUpdateInstall.create()
    scheduler_plugin.plugin.subscribe()

    # If windows os and daemon selected, start systray
    if passed_args.daemon and os.name == 'nt':
        systrayplugin = systray.SysTrayPlugin(cherrypy.engine)
        systrayplugin.subscribe()
        systrayplugin.start()

    os.chdir(core.PROG_PATH)  # have to do this for the daemon
    # finish by blocking
    cherrypy.engine.block()