Created
August 1, 2015 18:44
-
-
Save robertwb/03998f22f3792ad7b993 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import re | |
import sys | |
all = defaultdict(dict) | |
lineno = None | |
for line in sys.stdin: | |
m = re.match(r' */\* "(.*\.pyx)":(\d+)', line) | |
if m: | |
file = m.group(1) | |
lineno = int(m.group(2)) - 2 | |
print "found", m.groups() | |
elif '*/' in line: | |
lineno = None | |
elif lineno is not None: | |
all[file][lineno] = line[2:].rstrip() | |
lineno += 1 | |
for file, lines in all.items(): | |
print '=' * 20, file, '=' * 20 | |
for lineno, line in sorted(lines.items()): | |
print lineno, ':', line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment