예제 #1
0
파일: MainPanel.py 프로젝트: andrezgz/airs
    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()      
예제 #2
0
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)
예제 #3
0
파일: webdispatch.py 프로젝트: jorgb/airs
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)
예제 #4
0
파일: AirsFrame.py 프로젝트: jorgb/airs
    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)
예제 #5
0
    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)