| Conditions | 2 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Retry utilities module.""" |
||
| 32 | def for_all_methods(decorator: Callable, **kwargs) -> Callable: |
||
| 33 | """Decorator for all methods.""" |
||
| 34 | |||
| 35 | def decorated(cls): |
||
| 36 | for attr in [ |
||
| 37 | name |
||
| 38 | for name in dir(cls) |
||
| 39 | if callable(getattr(cls, name)) |
||
| 40 | and not name.startswith("_") |
||
| 41 | and not hasattr(getattr(cls, name), "__wrapped__") |
||
| 42 | ]: |
||
| 43 | setattr(cls, attr, decorator(getattr(cls, attr), **kwargs)) |
||
| 44 | return cls |
||
| 45 | |||
| 46 | return decorated |
||
| 47 |