diff python/actions.py @ 256:f40a172512c6

more playing around
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 16 Dec 2012 22:51:18 -0800
parents 1f7325245dc8
children f4594857d606
line wrap: on
line diff
--- a/python/actions.py	Sun Dec 16 22:27:28 2012 -0800
+++ b/python/actions.py	Sun Dec 16 22:51:18 2012 -0800
@@ -5,12 +5,13 @@
     def __init__(self):
         self.functions = {}
 
-    def __call__(self, function):
+    def __call__(self, function, *dependencies):
+        import pdb; pdb.set_trace()
         self.functions[function.func_name] = function
         return function
 
-    def do(self, func_name, *args, **kwargs):
-        pass
+    def do(self, func_name):
+        self.functions[func_name]()
 
 action = Actions()
 
@@ -18,9 +19,11 @@
 def foo():
     print "hello"
 
-@action
+@action('foo')
 def bar():
     print "goodbye"
 
 if __name__ == '__main__':
     pass
+
+action.do('bar')