Advertisement
egasimus

Untitled

Nov 2nd, 2013
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement