-from sys import argv
+import sys
from datetime import date
from os.path import dirname, isdir
from os import makedirs, system
import re
-rst2man = argv[1]
-sourcedir = argv[2]
-outdir = argv[3]
+rst2man = sys.argv[1]
+sourcedir = sys.argv[2]
+outdir = sys.argv[3]
+
+sys.path.insert(0, sourcedir)
+import conf
+
if not isdir(outdir):
makedirs(outdir, 0o755)
-execfile(sourcedir + "/conf.py")
-
def header(file, startdocname, command, description, authors, section):
file.write("""
'-' * len(description),
description,
'-' * len(description),
-date.today().isoformat(), release, section, project))
+date.today().isoformat(), conf.release, section, conf.project))
blankre = re.compile("^\s*$")
-for page in man_pages:
+for page in conf.man_pages:
outdirname = outdir + '/' + dirname(page[0])
if not isdir(outdirname):
makedirs(outdirname, 0o755)