Mercurial > hg > config
diff python/actions.py @ 254:56537ed6ebc6
sample actions file with dependencies (stub)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 16 Dec 2012 22:21:17 -0800 |
parents | |
children | 1f7325245dc8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/actions.py Sun Dec 16 22:21:17 2012 -0800 @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +class Actions(object): + + def __init__(self): + self.functions = {} + + def __call__(self, function): + return function + +action = Actions() + +@action +def foo(): + print "hello" + +@action +def bar(): + print "goodbye" + +if __name__ == '__main__': + pass