示例#1
0
 def unrar_thread(self, *args):
     """"""
     with self.lock:
         event = threading.Event()
         gobject.idle_add(self.unrar, event, *args)
         if register_event(event):  #set() event on exit app.
             event.wait()  #wait for set().
             remove_event(event)
示例#2
0
 def make_choice(self):
     if idle_queue.register_event(self.event):
         events.quality_choice_dialog.emit(self.f_name, self.choices_dict, self.set_solution)
         self.event.wait()
         self.event.clear() #re-use.
         idle_queue.remove_event(self.event)
         if not self.solution:
             logger.warning("No choice selected") #should not be possible
示例#3
0
 def unrar_thread(self, *args):
     """"""
     with self.lock:
         event = threading.Event()
         gobject.idle_add(self.unrar, event, *args)
         if register_event(event): #set() event on exit app.
             event.wait() #wait for set().
             remove_event(event)
示例#4
0
 def solve_captcha(self):
     """"""
     self.captcha_challenge = None
     if idle_queue.register_event(self.event):
         events.captcha_dialog.emit(self.service_name, self.get_captcha, self.set_solution)
         self.event.wait()
         self.event.clear() #re-use.
         idle_queue.remove_event(self.event)
         if not self.solution:
             logger.warning("No captcha response")
示例#5
0
 def solve_captcha(self):
     """"""
     self.captcha_challenge = None
     if idle_queue.register_event(self.event):
         events.trigger_captcha_dialog(self.service_name, self.get_captcha, self.set_solution)
         self.event.wait()
         self.event.clear() #re-use.
         idle_queue.remove_event(self.event)
         if not self.solution:
             logger.warning("No response for {0} event".format(cons.EVENT_CAPTCHA_DLG))
     return self.captcha_challenge, self.solution