Conditions | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | |||
9 | def trycatchslot(func): |
||
10 | """ |
||
11 | wrap a at slot. |
||
12 | log and call a method called show_error in |
||
13 | case of error |
||
14 | """ |
||
15 | def wrapper(self, *args): |
||
16 | # filter out excess args as qt signals do |
||
17 | sig = inspect.signature(func) |
||
18 | args = args[:(len(sig.parameters)-1)] |
||
19 | result = None |
||
20 | try: |
||
21 | result = func(self, *args) |
||
22 | except Exception as ex: |
||
34 |