diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-02-19 23:36:17 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-02-19 23:36:17 +0000 |
| commit | 06bcb61d2691eae37724eb82412bccd08af587f6 (patch) | |
| tree | 1df913bdc91c6999e9e9e33c37977d3ba339351e /lib/python/Tools/BoundFunction.py | |
| parent | 0b7d760a5cde7fc6efa6fe2cfa49b29df0386dab (diff) | |
| download | enigma2-06bcb61d2691eae37724eb82412bccd08af587f6.tar.gz enigma2-06bcb61d2691eae37724eb82412bccd08af587f6.zip | |
add kwargs support to boundFunction
Diffstat (limited to 'lib/python/Tools/BoundFunction.py')
| -rw-r--r-- | lib/python/Tools/BoundFunction.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/python/Tools/BoundFunction.py b/lib/python/Tools/BoundFunction.py index 5447451d..f28a50c8 100644 --- a/lib/python/Tools/BoundFunction.py +++ b/lib/python/Tools/BoundFunction.py @@ -1,6 +1,9 @@ class boundFunction: - def __init__(self, fnc, *args): + def __init__(self, fnc, *args, **kwargs): self.fnc = fnc self.args = args - def __call__(self, *args): - self.fnc(*self.args + args) + self.kwargs = kwargs + def __call__(self, *args, **kwargs): + newkwargs = self.kwargs + newkwargs.update(kwargs) + self.fnc(*self.args + args, **newkwargs) |
