def wrapper(*args, **kwargs): ff = functools.partial(function, *args, **kwargs) # if we are already in the main (UI) thread, execute now if is_mainthread(): ff() return # schedule the task to run in the main thread binaryninja.execute_on_main_thread(ff)
def wrapper(*args, **kwargs): ff = functools.partial(function, *args, **kwargs) # if we are already in the main (UI) thread, execute now if is_mainthread(): ff() return # schedule the task to run in the main thread try: binaryninja.execute_on_main_thread(ff) except AttributeError: # TODO/V35: binja bug, fixed on dev pass
def on_stdout(self, output): def on_stdout_main_thread(output): console_widget = self.widget('Debugger Console') console_widget.notifyStdout(output) execute_on_main_thread(lambda: on_stdout_main_thread(output))