--- a/docs/test2rst.py Thu Mar 02 20:22:29 2017 +0100
+++ b/docs/test2rst.py Thu Mar 02 20:23:18 2017 +0100
@@ -1,6 +1,9 @@
#!/usr/bin/env python
-import os, os.path as op, re, sys
+import os
+import os.path as op
+import re
+import sys
# line starts with two chars one of which is not a space (and both are not
# newlines obviously) and ends with one or more newlines followed by two spaces
@@ -32,7 +35,7 @@
def one_dir(base):
index = INDEX
- #doc = lambda x: op.join(op.dirname(__file__), 'docs', x)
+ # doc = lambda x: op.join(op.dirname(__file__), 'docs', x)
for fn in sorted(os.listdir(base)):
if not fn.endswith('.t'):
@@ -40,23 +43,23 @@
name = os.path.splitext(fn)[0]
content = one_file(op.join(base, fn))
target = op.join(base, name + '.rst')
- #with file(doc(name + '.rst'), 'w') as f:
- with file(target, 'w') as f:
+ # with file(doc(name + '.rst'), 'w') as f:
+ with open(target, 'w') as f:
f.write(content)
index += '\n ' + name
- #with file(doc('index.rst'), 'w') as f:
- # f.write(index)
+ # with file(doc('index.rst'), 'w') as f:
+ # f.write(index)
def one_file(path):
name = os.path.basename(path)[:-2]
- return rstify(file(path).read(), name)
+ return rstify(open(path).read(), name)
if __name__ == '__main__':
if len(sys.argv) != 2:
- print 'Please supply a path to tests dir as parameter'
+ print('Please supply a path to tests dir as parameter')
sys.exit()
main(sys.argv[1])