ulauncher.utils.decorator package¶
Submodules¶
ulauncher.utils.decorator.alias module¶
-
ulauncher.utils.decorator.alias.
alias
(alternative_function_name)¶
ulauncher.utils.decorator.debounce module¶
-
ulauncher.utils.decorator.debounce.
debounce
(wait)¶ Decorator that will postpone a functions execution until after wait seconds have elapsed since the last time it was invoked.
ulauncher.utils.decorator.glib_idle_add module¶
ulauncher.utils.decorator.run_async module¶
-
ulauncher.utils.decorator.run_async.
run_async
(*args, **kwargs)¶ Function decorator, intended to make “func” run in a new thread (asynchronously).
Return type: threading.Thread
Examples:
>>> @run_async >>> def task1(): >>> do_something >>> >>> @run_async(daemon=True) >>> def task2(): >>> do_something_too >>> >>> t1 = task1() >>> t2 = task2() >>> ... >>> t1.join() >>> t2.join()
ulauncher.utils.decorator.singleton module¶
-
ulauncher.utils.decorator.singleton.
singleton
(fn)¶ Decorator function. Call to a decorated function always returns the same instance
Note: it doesn’t take into account args and kwargs when looks up a saved instance Call a decorated function with spawn=True in order to get a new instance