55 |
|
|
56 |
umltool.settings['css'] = 'doc/gzz.css' |
umltool.settings['css'] = 'doc/gzz.css' |
57 |
|
|
58 |
|
def _slashify(path): |
59 |
|
"""Add a trailing slash if not already there. |
60 |
|
""" |
61 |
|
return (path+"/").replace("//","/") |
62 |
|
|
63 |
|
def _rstFiles(path): |
64 |
|
files = [f for f in os.listdir(path+'/') \ |
65 |
|
if os.path.isfile(path+'/'+f) and not f.startswith('.') |
66 |
|
and '#' not in f and '~' not in f] |
67 |
|
rstfiles = [f for f in files if f.endswith('.rst')] |
68 |
|
return rstfiles |
69 |
|
|
70 |
def run_convert(path): |
def run_convert(path): |
71 |
umltool.set_to_root(path) |
umltool.set_to_root(path) |
72 |
|
|
73 |
if os.path.isdir(path): |
if os.path.isdir(path): |
74 |
umltool.set_to_root((path+"/").replace("//", "/")) |
umltool.set_to_root(_slashify(path)) |
75 |
files = [f for f in os.listdir(path+'/') \ |
rstfiles = _rstFiles(path) |
|
if os.path.isfile(path+'/'+f) and not f.startswith('.') |
|
|
and '#' not in f and '~' not in f] |
|
|
rstfiles = [f for f in files if f.endswith('.rst')] |
|
|
|
|
76 |
for rstfile in rstfiles: |
for rstfile in rstfiles: |
77 |
rst2html(path+"/"+rstfile) |
rst2html(path+"/"+rstfile) |
78 |
|
|
86 |
umltool.set_to_root(path) |
umltool.set_to_root(path) |
87 |
|
|
88 |
if os.path.isdir(path): |
if os.path.isdir(path): |
89 |
umltool.set_to_root((path+"/").replace("//", "/")) |
umltool.set_to_root(_slashify(path)) |
90 |
files = [f for f in os.listdir(path+'/') \ |
rstfiles = _rstFiles(path) |
|
if os.path.isfile(path+'/'+f) and not f.startswith('.') |
|
|
and '#' not in f and '~' not in f] |
|
|
rstfiles = [f for f in files if f.endswith('.rst')] |
|
91 |
|
|
92 |
for rstfile in rstfiles: |
for rstfile in rstfiles: |
93 |
umlrst.embed_diagram(path+"/"+rstfile) |
umlrst.embed_diagram(path+"/"+rstfile) |