Return string with leading whitespace and '#' from line or ''. A null return indicates that the line is not a comment line. A non- null return, such as ' #', will be used to find the other lines of a comment block with the same indent.
(line)
| 185 | return re.match(r"^([ \t]*)", line).group() |
| 186 | |
| 187 | def get_comment_header(line): |
| 188 | """Return string with leading whitespace and '#' from line or ''. |
| 189 | |
| 190 | A null return indicates that the line is not a comment line. A non- |
| 191 | null return, such as ' #', will be used to find the other lines of |
| 192 | a comment block with the same indent. |
| 193 | """ |
| 194 | m = re.match(r"^([ \t]*#*)", line) |
| 195 | if m is None: return "" |
| 196 | return m.group(1) |
| 197 | |
| 198 | |
| 199 | # Copied from editor.py; importing it would cause an import cycle. |
no test coverage detected
searching dependent graphs…