[PATCH 3/3] doc: have prerst2man.py generate roff files all in one directory

David Bremner david at tethera.net
Mon Mar 10 19:18:29 PDT 2014


Originally it seemed tidier to put them in subdirectories, but it
turned out not to be obvious how to do that with sphinx. Bring the two
methods back in sync again, and unbreak the generation of gzipped
manpages.

As a side-effect, fix a particular egregious combination of format and
string concatenation.
---
 doc/prerst2man.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/doc/prerst2man.py b/doc/prerst2man.py
index 720deb6..adc0d3d 100644
--- a/doc/prerst2man.py
+++ b/doc/prerst2man.py
@@ -32,10 +32,8 @@ date.today().isoformat(), release, section, project))
 
 blankre = re.compile("^\s*$")
 for page in man_pages:
-    outdirname = outdir + '/' + dirname(page[0])
-    if not isdir(outdirname):
-        makedirs(outdirname, 0755)
-    filename = outdir + '/' + page[0] + '.rst'
+    print outdir
+    filename = outdir + '/' + page[1] + '.rst'
     outfile = open(filename, 'w')
     infile = open(sourcedir + '/' + page[0] + '.rst', 'r')
 
@@ -59,4 +57,5 @@ for page in man_pages:
     outfile.write("".join(lines))
     outfile.close()
 
-    os.system('set -x; rst2man {0} {1}'.format(filename, outdir + '/' + page[0] + '.' + str(page[4])))
+    os.system('set -x; rst2man {0} {1}/{2}.{3}'
+              .format(filename, outdir, page[1],page[4]))
-- 
1.8.5.3



More information about the notmuch mailing list