Advertisement
egasimus

Untitled

Nov 2nd, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def dist_task(f):
  2.     f.is_dist_task = True
  3.  
  4.  
  5. class Foo(object):
  6.     @dist_task
  7.     def install(self):
  8.         pass
  9.  
  10.     @property
  11.     def dist_tasks(self):
  12.         return {
  13.             x: getattr(self, x)
  14.             for x in dir(self)
  15.             if isroutine(getattr(self, x))
  16.             and getattr(getattr(self, x), 'is_dist_task', False)]
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement