6This is a tool which auto-generated documentation for all the python modules/executables which are included in the systematics-tools package.
8wdir=os.environ[
"SYSTTOOLSPATH"]
10docdir=wdir+
"/documentation"
11os.system(
"mkdir -p %s" % docdir)
12for pyfile
in os.listdir(pydir):
13 if re.findall(
".*py?",pyfile) != [pyfile]:
continue
14 if not (
".py" in pyfile
and pyfile[-1]==
'y'):
continue
15 if (
"updateDocumentation" in pyfile):
continue
16 print(
'processing ', pyfile)
17 pymodule=pyfile.replace(
".py",
"")
18 print(
"pydoc %s > %s/%s.doc" % (pymodule, docdir, pymodule))
19 os.system(
"pydoc %s > %s/%s.doc" % (pymodule, docdir, pymodule))
20 fin = open (
"%s/%s.doc" %(docdir, pymodule),
'r')
21 fout = open (
"%s/%s.md" %(docdir, pymodule),
'w')
23 for line
in fin.readlines():
27 if "FUNCTIONS" in line: inHeader=
False
29 if l==
" " and inPrefix: countSpaces+=1
38 if countSpaces==0
and len(line)>0:
40 elif countSpaces==4
and not inHeader
and len(line)>0:
44 if "Help on module" in lout: lout =
"Help on module %s" % pymodule
45 fout.write(
"%s\n" % lout)
void print(char *figname, TCanvas *c1)