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