29 |
|
|
30 |
import config |
import config |
31 |
|
|
32 |
import os, os.path |
import os, os.path, re |
33 |
import navidoc.link, navidoc.parser |
import navidoc.link, navidoc.parser |
34 |
|
|
35 |
from navidoc.utils.path import * |
from navidoc.utils.path import * |
37 |
dbg = config.dbg.shorthand('mp') |
dbg = config.dbg.shorthand('mp') |
38 |
dbg_fail = config.dbg.shorthand('mp.fail') |
dbg_fail = config.dbg.shorthand('mp.fail') |
39 |
|
|
40 |
def link_draw_code(self, target, title, bbox, focus=0, rough_edge=1, error=0): |
def link_draw_code(self): |
41 |
if error: return 'showlinkerror("'+target+'", '+title+', ('+box+'));' |
if self.error: return 'showlinkerror("'+self.target+'", '+self.title+', ('+self.bbox+'));' |
42 |
if not focus: return 'showlink("'+target+'", '+title+', ('+box+'));' |
if not self.focus: return 'showlink("'+self.target+'", '+self.title+', ('+self.bbox+'));' |
43 |
else: |
else: |
44 |
if rough_edge: return 'showfocus("'+target+'", '+title+', ('+box+'));'+"\n"+'drawRoughEdge(('+box+'));' |
if self.rough_edge: |
45 |
else: return 'showfocus("'+target+'", '+title+', ('+box+'));' |
return 'showfocus("'+self.target+'", '+self.title+', ('+self.bbox+'));' \ |
46 |
|
+"\n"+'drawRoughEdge(('+bbox+'));' |
47 |
|
else: return 'showfocus("'+self.target+'", '+self.title+', ('+self.box+'));' |
48 |
navidoc.link.Link.draw_code = link_draw_code |
navidoc.link.Link.draw_code = link_draw_code |
49 |
|
|
50 |
class MetapostElement(navidoc.NamedElement): |
class MetapostElement(navidoc.NamedElement): |
76 |
raise MetapostException(slashify(config.mp_directory)+diagram+'.gen.mp'+' not found') |
raise MetapostException(slashify(config.mp_directory)+diagram+'.gen.mp'+' not found') |
77 |
|
|
78 |
s = open(slashify(config.mp_directory)+diagram+'.gen.uml').read() |
s = open(slashify(config.mp_directory)+diagram+'.gen.uml').read() |
79 |
l = parseIndented(s) |
l = navidoc.utils.parser.parse_indented(s) |
80 |
m = mplist(l) |
m = navidoc.parser.ElementList(l) |
81 |
|
|
82 |
if len(extension) > 0: extension = '_'+extension |
if len(extension) > 0: extension = '_'+extension |
83 |
|
|