| Conditions | 5 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 23 | def list_keys(keypath, separator): |
||
| 24 | """ |
||
| 25 | List keys splitting a keypath using the given separator. |
||
| 26 | """ |
||
| 27 | if isinstance(keypath, string_types): |
||
| 28 | if separator: |
||
| 29 | return keypath.split(separator) |
||
| 30 | elif isinstance(keypath, (list, tuple, )): |
||
| 31 | keys = [] |
||
| 32 | for key in keypath: |
||
| 33 | keys += list_keys(key, separator) |
||
| 34 | return keys |
||
| 35 | return [keypath] |
||
| 36 |