| Conditions | 6 |
| Total Lines | 17 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 47 | def split_keys(key, separator): |
||
| 48 | if not separator: |
||
| 49 | return [key] |
||
| 50 | elif isinstance(key, string_types): |
||
| 51 | keypath = key |
||
| 52 | if separator in keypath: |
||
| 53 | keys = list(keypath.split(separator)) |
||
| 54 | return keys |
||
| 55 | else: |
||
| 56 | return [key] |
||
| 57 | elif isinstance(key, (list, tuple, )): |
||
| 58 | keys = [] |
||
| 59 | for key_item in key: |
||
| 60 | keys += split_keys(key_item, separator) |
||
| 61 | return keys |
||
| 62 | else: |
||
| 63 | return [key] |
||
| 64 |