Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero.
(line)
| 1772 | |
| 1773 | |
| 1774 | def GetIndentLevel(line): |
| 1775 | """Return the number of leading spaces in line. |
| 1776 | |
| 1777 | Args: |
| 1778 | line: A string to check. |
| 1779 | |
| 1780 | Returns: |
| 1781 | An integer count of leading spaces, possibly zero. |
| 1782 | """ |
| 1783 | indent = Match(r'^( *)\S', line) |
| 1784 | if indent: |
| 1785 | return len(indent.group(1)) |
| 1786 | else: |
| 1787 | return 0 |
| 1788 | |
| 1789 | def PathSplitToList(path): |
| 1790 | """Returns the path split into a list by the separator. |
no test coverage detected