def _send( self, cmd, title, info_succ='succeeded', info_fail='failed' ): if self.manager.server: import time time.sleep(1) if title != None: result=tunnel.send( cmd ) #result='succeeded' if result == 'succeeded': gobject.idle_add( self.notify, title, 'succeeded' ) if result == 'wait': gobject.idle_add( self.notify, title, 'please wait, it\'s running for you') import time while result=='wait': time.sleep(1) result=tunnel.send('query') gobject.idle_add(self.notify, title,result) else: gobject.idle_add( self.notify, title, 'failed' ) else: tunnel.send( cmd )
def _send(self, cmd, title, info_succ='succeeded', info_fail='failed'): if self.manager.server: import time time.sleep(1) if title != None: result = tunnel.send(cmd) #result='succeeded' if result == 'succeeded': gobject.idle_add(self.notify, title, 'succeeded') if result == 'wait': gobject.idle_add(self.notify, title, 'please wait, it\'s running for you') import time while result == 'wait': time.sleep(1) result = tunnel.send('query') gobject.idle_add(self.notify, title, result) else: gobject.idle_add(self.notify, title, 'failed') else: tunnel.send(cmd)
def send( self, cmd, title = None, info_succ = "succeeded", info_fail = "failed" ): import threading if ( self.manager.server == False): m_thread = threading.Thread( target = self.start_server ) m_thread.start() self.manager.server = True if cmd=='reconf': result=tunnel.send(cmd) gobject.idle_add(self.notify, title, result) else: m_thread = threading.Thread( target = self._send, args = ( cmd, title, info_succ, info_fail, ) ) m_thread.start()
def send(self, cmd, title=None, info_succ="succeeded", info_fail="failed"): import threading if (self.manager.server == False): m_thread = threading.Thread(target=self.start_server) m_thread.start() self.manager.server = True if cmd == 'reconf': result = tunnel.send(cmd) gobject.idle_add(self.notify, title, result) else: m_thread = threading.Thread(target=self._send, args=( cmd, title, info_succ, info_fail, )) m_thread.start()