# HG changeset patch # User Jeff Hammel # Date 1355727078 28800 # Node ID f40a172512c6e565a6891f38bc7656783af7b0bb # Parent 1f7325245dc892608bf623203733a41c15cce7d8 more playing around diff -r 1f7325245dc8 -r f40a172512c6 python/actions.py --- 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')