Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
(line)
| 2248 | |
| 2249 | |
| 2250 | def GetIndentLevel(line): |
| 2251 | """Return the number of leading spaces in line. |
| 2252 | |
| 2253 | Args: |
| 2254 | line: A string to check. |
| 2255 | |
| 2256 | Returns: |
| 2257 | An integer count of leading spaces, possibly zero. |
| 2258 | """ |
| 2259 | indent = Match(r'^( *)\S', line) |
| 2260 | if indent: |
| 2261 | return len(indent.group(1)) |
| 2262 | else: |
| 2263 | return 0 |
| 2264 | |
| 2265 | def PathSplitToList(path): |
| 2266 | """Returns the path split into a list by the separator. |
no test coverage detected