mirror of
https://github.com/rspeer/wordfreq.git
synced 2024-12-23 09:21:37 +00:00
parent
44c655d9a6
commit
247d7c6579
@ -11,18 +11,20 @@ def ninja_to_dot():
|
|||||||
print('rankdir="LR";')
|
print('rankdir="LR";')
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
parts = line.split(' ')
|
if line.startswith('build'):
|
||||||
if parts[0] == 'build':
|
|
||||||
# the output file is the first argument; strip off the colon that
|
# the output file is the first argument; strip off the colon that
|
||||||
# comes from ninja syntax
|
# comes from ninja syntax
|
||||||
outfile = last_component(parts[1][:-1])
|
output_text, input_text = line.split(':')
|
||||||
operation = parts[2]
|
outfiles = [last_component(part) for part in output_text.split(' ')[1:]]
|
||||||
infiles = [last_component(part) for part in parts[3:]]
|
inputs = input_text.strip().split(' ')
|
||||||
|
infiles = [last_component(part) for part in inputs[1:]]
|
||||||
|
operation = inputs[0]
|
||||||
for infile in infiles:
|
for infile in infiles:
|
||||||
if infile == '|':
|
if infile == '|':
|
||||||
# external dependencies start here; let's not graph those
|
# external dependencies start here; let's not graph those
|
||||||
break
|
break
|
||||||
print('"%s" -> "%s" [label="%s"]' % (infile, outfile, operation))
|
for outfile in outfiles:
|
||||||
|
print('"%s" -> "%s" [label="%s"]' % (infile, outfile, operation))
|
||||||
print("}")
|
print("}")
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB |
1
wordfreq_builder/build.png.REMOVED.git-id
Normal file
1
wordfreq_builder/build.png.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
|||||||
|
ef54b21e931c530f5b75c1cd87c5841cc4691e43
|
Loading…
Reference in New Issue
Block a user