Conditions | 3 |
Total Lines | 13 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | def add_callback(before=None, after=None): |
||
2 | def decorator(function): |
||
3 | def wrapper(self, param): |
||
4 | if before: |
||
5 | [before_callback(self, param) for before_callback in before] |
||
6 | result = function(self, param) |
||
7 | if after: |
||
8 | [after_callback(self, param) for after_callback in after] |
||
9 | return result |
||
10 | |||
11 | return wrapper |
||
12 | |||
13 | return decorator |
||
14 | |||
29 |