def call_handler(self, method, msg): try: if isinstance(msg, CancelFileOperations): # handle this message as soon as we can. handle_task(method, msg) elif isinstance(msg, MovieDataProgramTask): # we have to handle this message on this thread, since # QtKit will break if we use it on any thread except the main # one. Put it in main_thread_tasks and handle once # there's no more tasks waiting in to be processed self.main_thread_tasks.append((method, msg)) elif isinstance(msg, MutagenTask): # If we're using the alarm, then MutagenTasks need to run in # the main thread as well. Signals aren't support outside of # the main thread. if self.supports_alarm: self.main_thread_tasks.append((method, msg)) else: self.task_queue.add_task(method, msg) elif isinstance(msg, TaskMessage): self.task_queue.add_task(method, msg) else: method(msg) except StandardError: subprocessmanager.send_subprocess_error_for_exception()
def call_handler(self, method, msg): try: if isinstance(msg, CancelFileOperations): # handle this message as soon as we can. handle_task(method, msg) elif isinstance(msg, MovieDataProgramTask): # we have to handle this message on this thread, since # QtKit will break if we use it on any thread except the main # one. Put it in pending_moviedata_tasks and handle once # there's no more tasks waiting in to be processed self.pending_moviedata_tasks.append((method, msg)) elif isinstance(msg, TaskMessage): self.task_queue.add_task(method, msg) else: method(msg) except StandardError: subprocessmanager.send_subprocess_error_for_exception()