X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Futil%2Fcoroutines.py;h=b1e539e91f2959d9a83dcdbcab5cf318de768744;hb=b21a1dad2e1e82e1ae140955adf8dc977cf9cf27;hp=6d802e85a81ca2745d1f0976b8e0c0a9487e02c1;hpb=ab4da214c520d763bbbddeb828c8e7c838374fe3;p=theonering diff --git a/src/util/coroutines.py b/src/util/coroutines.py index 6d802e8..b1e539e 100755 --- a/src/util/coroutines.py +++ b/src/util/coroutines.py @@ -156,6 +156,19 @@ def comap(function, target): target.throw(e.__class__, e.message) +def func_sink(function): + return comap(function, null_sink()) + + +def expand_positional(function): + + @functools.wraps(function) + def expander(item): + return function(*item) + + return expander + + @autostart def append_sink(l): """