(path, delimiter=PathDelimiter)
| 72 | |
| 73 | |
| 74 | def path_components(path, delimiter=PathDelimiter): # type: (str, str) -> Iterable[str] |
| 75 | p = path.strip() |
| 76 | pos = 0 |
| 77 | while pos < len(p): |
| 78 | idx = p.find(delimiter, pos) |
| 79 | if idx >= 0: |
| 80 | if idx+1 < len(p): |
| 81 | if p[idx+1] == delimiter: |
| 82 | pos = idx + 2 |
| 83 | continue |
| 84 | comp = p[:idx].strip() |
| 85 | p = p[idx+1:].strip() |
| 86 | pos = 0 |
| 87 | if len(comp) > 0: |
| 88 | yield comp.replace(2*delimiter, delimiter) |
| 89 | else: |
| 90 | p = strip_path_delimiter(p, delimiter=delimiter) |
| 91 | if len(p) > 0: |
| 92 | yield p.replace(2*delimiter, delimiter) |
| 93 | p = '' |
| 94 | |
| 95 | |
| 96 | def check_if_bool(value): |
no test coverage detected