32 |
|
|
33 |
import config |
import config |
34 |
|
|
35 |
from navidoc.utils.path import _slashify, relative_path |
from navidoc.utils.path import * |
36 |
from navidoc.mp.core import mp2png, uml |
from navidoc.mp import mp2png, create_uml |
37 |
|
|
38 |
dbg = config.dbg.shorthand('mp') |
dbg = config.dbg.shorthand('mp') |
39 |
dbg_fail = config.dbg.shorthand('mp.fail') |
dbg_fail = config.dbg.shorthand('mp.fail') |
49 |
eps_only = config.mp_eps_only # should no png files be generated |
eps_only = config.mp_eps_only # should no png files be generated |
50 |
|
|
51 |
attributes = {'name': arguments[0]} |
attributes = {'name': arguments[0]} |
52 |
options['uri'] = _slashify(to_tmpdir)+attributes['name'] |
options['uri'] = slashify(to_tmpdir)+attributes['name'] |
53 |
if not eps_only: options['uri'] += '.gen.png' |
if not eps_only: options['uri'] += '.gen.png' |
54 |
else: options['uri'] += '_gen.eps' |
else: options['uri'] += '_gen.eps' |
55 |
options['alt'] = attributes['name'] |
options['alt'] = attributes['name'] |
63 |
# XXX fatal error should be made if a diagram with the same name |
# XXX fatal error should be made if a diagram with the same name |
64 |
# already exists. |
# already exists. |
65 |
|
|
66 |
mp_filename = _slashify(config.mp_directory)+attributes['name'] |
mp_filename = slashify(config.mp_directory)+attributes['name'] |
67 |
if not eps_only: mp = open(mp_filename+'.gen.mp.3', 'w') |
if not eps_only: mp = open(mp_filename+'.gen.mp.3', 'w') |
68 |
else: mp = open(mp_filename+'_gen.eps', 'w') |
else: mp = open(mp_filename+'_gen.eps', 'w') |
69 |
mp.write(temp) |
mp.write(temp) |
89 |
eps_only = config.mp_eps_only # should no png files be generated |
eps_only = config.mp_eps_only # should no png files be generated |
90 |
|
|
91 |
attributes = {'name': arguments[0]} |
attributes = {'name': arguments[0]} |
92 |
src = _slashify(to_tmpdir)+attributes['name'] |
src = slashify(to_tmpdir)+attributes['name'] |
93 |
if not eps_only: src += '.gen.png' |
if not eps_only: src += '.gen.png' |
94 |
else: src += '_gen.eps' |
else: src += '_gen.eps' |
95 |
|
|
123 |
# already exists. |
# already exists. |
124 |
|
|
125 |
# writes uml and mp sourcefiles and converts them into png and html |
# writes uml and mp sourcefiles and converts them into png and html |
126 |
dir = _slashify(config.mp_directory) |
dir = slashify(config.mp_directory) |
127 |
diagram = attributes['name'] |
diagram = attributes['name'] |
128 |
|
|
129 |
uml_file = open(dir+diagram+'.gen.uml', 'w') |
uml_file = open(dir+diagram+'.gen.uml', 'w') |
159 |
eps_only = config.mp_eps_only # should no png files be generated |
eps_only = config.mp_eps_only # should no png files be generated |
160 |
|
|
161 |
attributes = {'name': arguments[0]} |
attributes = {'name': arguments[0]} |
162 |
src = _slashify(to_tmpdir)+attributes['name'] |
src = slashify(to_tmpdir)+attributes['name'] |
163 |
if not eps_only: src += '.gen.png' |
if not eps_only: src += '.gen.png' |
164 |
else: src += '_gen.eps' |
else: src += '_gen.eps' |
165 |
|
|
180 |
""" |
""" |
181 |
Add reference information for a spesific diagram. |
Add reference information for a spesific diagram. |
182 |
""" |
""" |
183 |
refers_filepath = _slashify(config.working_directory)+diagram+".gen.refers" |
refers_filepath = slashify(config.working_directory)+diagram+".gen.refers" |
184 |
if (os.path.isfile(refers_filepath)): |
if (os.path.isfile(refers_filepath)): |
185 |
old_refers = open(refers_filepath, "r").read() |
old_refers = open(refers_filepath, "r").read() |
186 |
if old_refers.find(config.output_filename) == -1: |
if old_refers.find(config.output_filename) == -1: |