Normalize the path. But not if that gets rid of a variable, as this may expand to something larger than one directory. Arguments: source: The path to be normalize.d Returns: The normalized path.
(source)
| 134 | |
| 135 | |
| 136 | def _NormalizedSource(source): |
| 137 | """Normalize the path. |
| 138 | |
| 139 | But not if that gets rid of a variable, as this may expand to something |
| 140 | larger than one directory. |
| 141 | |
| 142 | Arguments: |
| 143 | source: The path to be normalize.d |
| 144 | |
| 145 | Returns: |
| 146 | The normalized path. |
| 147 | """ |
| 148 | normalized = os.path.normpath(source) |
| 149 | if source.count("$") == normalized.count("$"): |
| 150 | source = normalized |
| 151 | return source |
| 152 | |
| 153 | |
| 154 | def _FixPath(path, separator="\\"): |
no test coverage detected