| Conditions | 2 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | def add_callback(before=None, after=None): |
||
| 16 | def add_catch(catch): |
||
| 17 | def decorator(function): |
||
| 18 | def wrapper(self, param): |
||
| 19 | try: |
||
| 20 | result = function(self, param) |
||
| 21 | except tuple(catch.keys()) as e: |
||
| 22 | result = catch[e.__class__] |
||
| 23 | |||
| 24 | return result |
||
| 25 | |||
| 26 | return wrapper |
||
| 27 | |||
| 28 | return decorator |
||
| 29 |