| Conditions | 5 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 22.5589 |
| 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( |
||
| 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 is None or service in IGNORED_SERVICES: |
||
| 33 | logger.info('Ignoring service: %s' % service) |
||
| 34 | continue |
||
| 35 | |||
| 36 | # Log unsupported service warning |
||
| 37 | logger.warn('Unsupported service: %s' % service, extra={ |
||
| 38 | 'event': { |
||
| 39 | 'module': __name__, |
||
| 40 | 'name': 'unsupported_service', |
||
| 41 | 'key': service |
||
| 42 | } |
||
| 54 |