add boundFunction to Tools
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 22 Nov 2005 01:35:21 +0000 (01:35 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 22 Nov 2005 01:35:21 +0000 (01:35 +0000)
lib/python/Tools/BoundFunction.py [new file with mode: 0644]
lib/python/Tools/Makefile.am
lib/python/Tools/__init__.py

diff --git a/lib/python/Tools/BoundFunction.py b/lib/python/Tools/BoundFunction.py
new file mode 100644 (file)
index 0000000..5447451
--- /dev/null
@@ -0,0 +1,6 @@
+class boundFunction:
+       def __init__(self, fnc, *args):
+               self.fnc = fnc
+               self.args = args
+       def __call__(self, *args):
+               self.fnc(*self.args + args)
index 9d21e45..36b3cc9 100644 (file)
@@ -1,4 +1,4 @@
 installdir = $(LIBDIR)/enigma2/python/Tools
 
 install_DATA = \
 installdir = $(LIBDIR)/enigma2/python/Tools
 
 install_DATA = \
-       FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py KeyBindings.py __init__.py
+       FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py KeyBindings.py BoundFunction.py __init__.py
index d8e646d..3a1fe74 100644 (file)
@@ -1 +1 @@
-all = ["FuzzyDate.py", "XMLTools.py", "Directories.py", "KeyBindings.py"]
+all = ["FuzzyDate.py", "XMLTools.py", "Directories.py", "KeyBindings.py", "BoundFunction.py"]