Coverage for lutris.util.jobs : 22%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Launch given function `func` in a new thread """ logger.debug("Async call: %s", str(func.__name__)) if not on_done: on_done = lambda r, e: None
def do_call(*args, **kwargs): result = None error = None
try: result = func(*args, **kwargs) except Exception, err: logger.error("Error while completing task %s: %s", func, err) #raise # Uncomment this to inspect errors error = err GLib.idle_add(lambda: on_done(result, error))
thread = threading.Thread(target=do_call, args=args, kwargs=kwargs) thread.start() |