| Total Complexity | 5 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| 1 | 1 | from plugin.core.constants import GUID_SERVICES |
|
| 10 | 1 | class Identifier(object): |
|
| 11 | 1 | @classmethod |
|
| 12 | 1 | def get_ids(cls, guid, strict=True): |
|
| 13 | 1 | ids = {} |
|
| 14 | |||
| 15 | 1 | if not guid: |
|
| 16 | 1 | return ids |
|
| 17 | |||
| 18 | 1 | if type(guid) is str: |
|
| 19 | # Parse raw guid |
||
| 20 | 1 | guid = Guid.parse(guid) |
|
| 21 | |||
| 22 | 1 | if guid.service in GUID_SERVICES: |
|
| 23 | 1 | ids[guid.service] = guid.id |
|
| 24 | 1 | elif not strict: |
|
| 25 | 1 | log.info('Unknown identifier service: "%s"', guid.service) |
|
| 26 | else: |
||
| 27 | 1 | log.info('Unknown identifier service: "%s" [strict]', guid.service) |
|
| 28 | 1 | return None |
|
| 29 | |||
| 30 | return ids |
||
| 31 |