Conditions | 4 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 1 |
CRAP Score | 15.664 |
1 | 1 | from plugin.sync.modes.core.base.mode import Mode |
|
19 | 1 | def log_unsupported(logger, message, dictionary): |
|
20 | if len(dictionary) < 1: |
||
21 | return |
||
22 | |||
23 | # Display unsupported service list |
||
24 | logger.info( |
||
25 | message, |
||
26 | len(dictionary), |
||
27 | '\n'.join(format_unsupported(dictionary)) |
||
28 | ) |
||
29 | |||
30 | # Display individual warnings for each service |
||
31 | for service in dictionary.keys(): |
||
32 | if service not in unsupported_services: |
||
33 | # First occurrence of unsupported service |
||
34 | logger.warn('Unsupported service: %s' % service) |
||
35 | |||
36 | # Mark unsupported service as "seen" |
||
37 | unsupported_services[service] = True |
||
38 | continue |
||
39 | |||
40 | # Duplicate occurrence of unsupported service |
||
41 | logger.warn('Unsupported service: %s' % service, extra={ |
||
42 | 'duplicate': True |
||
43 | }) |
||
54 |