12345678910111213141516171819202122232425262728293031 |
- def with_help(help_msg):
- def getter(self):
- return help_msg
-
- def decorator(cls):
- setattr(cls, "help_msg", getter)
- return cls
- return decorator
- def with_startup(startup):
- def new_startup(self, db):
- return startup(self, db)
-
- def decorator(cls):
- setattr(cls, "on_start", new_startup)
- return cls
- return decorator
- def with_shutdown(shutdown):
- def new_shutdown(self, db):
- return shutdown(self, db)
-
- def decorator(cls):
- setattr(cls, "on_shutdown", new_shutdown)
- return cls
- return decorator
|