From: Ed Page Date: Wed, 30 Sep 2009 02:58:21 +0000 (-0500) Subject: Forgot to add these changes which are needed by the addressbook X-Git-Url: http://git.maemo.org/git/?p=theonering;a=commitdiff_plain;h=0dfbbf5e5f2f9fb66d8b65ebfac28f87c474d7b2 Forgot to add these changes which are needed by the addressbook --- 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): """ diff --git a/src/util/misc.py b/src/util/misc.py index 7abecf3..85c6ca0 100644 --- a/src/util/misc.py +++ b/src/util/misc.py @@ -6,7 +6,6 @@ import sys import cPickle import functools -import itertools import contextlib import inspect