85 |
Returns a comment node with name of the diagram. |
Returns a comment node with name of the diagram. |
86 |
""" |
""" |
87 |
attributes = {'name': arguments[0]} |
attributes = {'name': arguments[0]} |
88 |
if content: |
uml_node = docutils.nodes.comment('', 'UML:'+attributes['name']) |
|
uml_node = docutils.nodes.comment('', 'UML:'+attributes['name']) |
|
89 |
|
|
90 |
return [uml_node] |
return [uml_node] |
91 |
|
|
117 |
if (os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.uml")): |
if (os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.uml")): |
118 |
prefix = name + ".gen" |
prefix = name + ".gen" |
119 |
else: prefix = name |
else: prefix = name |
120 |
assert os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".uml")\ |
assert (os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".uml")\ |
121 |
and os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".mp") |
and os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".mp")),\ |
122 |
|
"file "+ prefix+".uml or "+prefix+".mp not found" |
123 |
|
print "Embedding %s into %s" % (name, path) |
124 |
create_diagram(prefix) |
create_diagram(prefix) |
125 |
assert os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".html")\ |
assert (os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.html")\ |
126 |
and os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".png") |
and os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.png")),\ |
127 |
|
"file "+name+".gen.html or "+name+".gen.png not found" |
128 |
|
|
129 |
#Cut&Pastes imagemap into html |
#Cut&Pastes imagemap into html |
130 |
imgmap = open(umltool.settings['tmpdir']+"/"+prefix+".html").read() |
imgmap = open(umltool.settings['tmpdir']+"/"+name+".gen.html").read() |
131 |
out.write("<map name=\""+name+"\">\n") |
out.write("<map name=\""+name+"\">\n") |
132 |
out.write(imgmap[imgmap.find('>',imgmap.find('<map'))+1:\ |
out.write(imgmap[imgmap.find('>',imgmap.find('<map'))+1:\ |
133 |
imgmap.find('</map>')]) |
imgmap.find('</map>')]) |
134 |
out.write("</map>\n") |
out.write("</map>\n") |
135 |
out.write("<img src=\""+umltool.settings['to_tmpdir']+"/"+prefix+".png"\ |
out.write("<img src=\""+umltool.settings['to_tmpdir']+"/"+name+".gen.png"\ |
136 |
+"\" usemap=\""+name+"\"/>") |
+"\" usemap=\""+name+"\"/>") |
137 |
html = html[html.find("-->", insert)+3:len(html)] |
html = html[html.find("-->", insert)+3:len(html)] |
138 |
insert = html.find("<!-- UML:") |
insert = html.find("<!-- UML:") |