Skip to content

Commit 9322bc0

Browse files
committed
Update add-analytics script
1 parent e0300fb commit 9322bc0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

qpython-docs/add-analytics.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
with open(sys.argv[1], 'r') as f, open('/tmp/qpydoc.tmp', 'wb') as g, open(os.path.dirname(os.path.abspath(__file__))+'/extra.txt','r') as e:
33
pth = sys.argv[1][1:]
44
extra = "".join(e.readlines()).replace("{{PTH}}",pth)
5-
content = '\n'.join(
5+
g.write('\n'.join(
66
filter(lambda s: len(s),
77
map(lambda s:
88
('',extra+"<hr/>")[s=='<div role="contentinfo">']+s,
9-
map(str.strip, f.readlines()))))
10-
g.write(content)
9+
map(str.strip, f.readlines())))))
1110
os.rename('/tmp/qpydoc.tmp', sys.argv[1])

0 commit comments

Comments
 (0)