/[gzz]/gzz/metacode/umlrst.py
ViewVC logotype

Diff of /gzz/metacode/umlrst.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by humppake, Wed Dec 18 11:36:53 2002 UTC revision 1.6 by humppake, Wed Dec 18 15:56:09 2002 UTC
# Line 85  def uml_refer_directive(name, arguments, Line 85  def uml_refer_directive(name, arguments,
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    
# Line 118  def embed_diagram(path): Line 117  def embed_diagram(path):
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:")

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26