Skip to content

Commit b83fab3

Browse files
author
黄佰荣
committed
代码还原
1 parent dfe7803 commit b83fab3

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

qpython-docs/add-analytics.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import sys, os
2-
3-
with open(sys.argv[1], 'r', encoding='gbk') as f, \
4-
open('./qpydoc.tmp', 'w', encoding='gbk') as g, \
5-
open(os.path.dirname(os.path.abspath(__file__)) + '/extra.txt', 'r', encoding='gbk') as e:
1+
import sys,os
2+
with open(sys.argv[1], 'r') as f, open('./qpydoc.tmp', 'wb') as g, open(os.path.dirname(os.path.abspath(__file__))+'/extra.txt','r') as e:
63
pth = sys.argv[1][1:]
7-
extra = "".join(e.readlines()).replace("{{PTH}}", pth)
4+
extra = "".join(e.readlines()).replace("{{PTH}}",pth)
85
g.write('\n'.join(
96
filter(lambda s: len(s),
107
map(lambda s:
11-
('', extra + "<hr/>")[s == '<div role="contentinfo">'] + s,
8+
('',extra+"<hr/>")[s=='<div role="contentinfo">']+s,
129
map(str.strip, f.readlines())))))
13-
os.rename('./qpydoc.tmp', sys.argv[1])
10+
os.rename('./qpydoc.tmp', sys.argv[1])

0 commit comments

Comments
 (0)