def _onTimer(self, event): """ Periodic update event to control the throbber and other menu elements """ # send messages from thread queue to log window q = viewmgr.retriever.msg_queue msgs = 30 while not q.empty() and msgs > 0: viewmgr.app_log(q.get()) msgs -= 1 # send messages from webserver queue to log window q = reactor.msg_queue msgs = 30 while not q.empty() and msgs > 0: viewmgr.app_log(q.get()) msgs -= 1 # show queue progress bs, cs = viewmgr.retriever.getProgress() self._queue.SetRange(bs) self._queue.SetValue(cs) # kick view manager to probe for new series viewmgr.probe_series()
def execute(cmd, id, args): cb = synccmd.SyncCommand(id) if cmd in _cmd_dispatcher: try: _cmd_dispatcher[cmd](cb, args) except WebDispatchError, msg: viewmgr.app_log("Internal error occured: %s" % str(msg)) cb.html = "<h1>Internal Error Occured</h1><br>%s" % str(msg)
def _onWebRequest(self, event): """ Handle request of the web browser plugin """ id = event.callid cmd = event.cmd args = event.args viewmgr.app_log("Received command '%s' with id %i from web browser" % (cmd, id)) if cmd == "show_airs": viewmgr.set_view(series_filter.VIEW_WHATS_ON) wx.CallLater(500, self._doRestore) webdispatch.execute(cmd, id, args)