attachers.py 391 B

1234567891011121314151617181920
  1. def with_help(help_msg):
  2. def getter(self):
  3. return help_msg
  4. def decorator(cls):
  5. setattr(cls, "help_msg", getter)
  6. return cls
  7. return decorator
  8. def with_startup(startup):
  9. def new_startup(self, db):
  10. return startup(self, db)
  11. def decorator(cls):
  12. setattr(cls, "on_start", new_startup)
  13. return cls
  14. return decorator