| Conditions | 4 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 15.664 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 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(message, len(dictionary)) |
||
| 25 | |||
| 26 | # Display individual warnings for each service |
||
| 27 | for service in dictionary.keys(): |
||
| 28 | if service not in unsupported_services: |
||
| 29 | # First occurrence of unsupported service |
||
| 30 | logger.warn('Unsupported service: %s' % service) |
||
| 31 | |||
| 32 | # Mark unsupported service as "seen" |
||
| 33 | unsupported_services[service] = True |
||
| 34 | continue |
||
| 35 | |||
| 36 | # Duplicate occurrence of unsupported service |
||
| 37 | logger.warn('Unsupported service: %s' % service, extra={ |
||
| 38 | 'duplicate': True |
||
| 39 | }) |
||
| 40 |