/[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.21 by Vegai, Mon Feb 3 10:15:31 2003 UTC revision 1.22 by Vegai, Mon Feb 3 10:30:00 2003 UTC
# Line 194  def embed_implicit(oldpath, name, path): Line 194  def embed_implicit(oldpath, name, path):
194          if slash != -1:          if slash != -1:
195              path = (oldpath[0:slash+1] + path).replace("//", "/")              path = (oldpath[0:slash+1] + path).replace("//", "/")
196    
197      settings2 = settings.resist()      settings2 = settings.copy()
198    
199      umltool.set_transition_paths(path)      umltool.set_transition_paths(path)
200      slash = oldpath.rfind("/")      slash = oldpath.rfind("/")
201      if slash != -1:      if slash != -1:
202          settings2['to_context'] = mputils.transition_path(path, oldpath[0:slash])          settings['to_context'] = mputils.transition_path(path, oldpath[0:slash])
203      else: settings2['to_context'] = mputils.transition_path(path, oldpath)      else: settings['to_context'] = mputils.transition_path(path, oldpath)
204    
205      #the second pass - adds uml into html      #the second pass - adds uml into html
206      if path.endswith(".rst"): path = path[0:len(path)-4]      if path.endswith(".rst"): path = path[0:len(path)-4]
# Line 217  def embed_implicit(oldpath, name, path): Line 217  def embed_implicit(oldpath, name, path):
217    
218              #This should work also with non-generated UML-diagrams. Checks first              #This should work also with non-generated UML-diagrams. Checks first
219              #for generated and then if non-generated diagram exists.              #for generated and then if non-generated diagram exists.
220              if (os.path.isfile(mputils._slashify(settings2['tmpdir'])\              if (os.path.isfile(mputils._slashify(settings['tmpdir'])\
221                                 +name+".gen.uml")):                                 +name+".gen.uml")):
222                  old_prefix = name + ".gen"                  old_prefix = name + ".gen"
223              else: old_prefix = name              else: old_prefix = name
# Line 230  def embed_implicit(oldpath, name, path): Line 230  def embed_implicit(oldpath, name, path):
230              create_diagram(old_prefix, context_name, 0.5)              create_diagram(old_prefix, context_name, 0.5)
231                    
232              #Cut&Pastes imagemap into html              #Cut&Pastes imagemap into html
233              imgmap = open(mputils._slashify(settings2['tmpdir'])\              imgmap = open(mputils._slashify(settings['tmpdir'])\
234                            +context_name+".gen.html").read()                            +context_name+".gen.html").read()
235              out.write("<map id=\""+name+"\" name=\""+name+"\">\n")              out.write("<map id=\""+name+"\" name=\""+name+"\">\n")
236              out.write(imgmap[imgmap.find('>',imgmap.find('<map'))+1:\              out.write(imgmap[imgmap.find('>',imgmap.find('<map'))+1:\
237                               imgmap.find('</map>')])                               imgmap.find('</map>')])
238              out.write("</map>\n")              out.write("</map>\n")
239              out.write("<div class=\"uml-implicit\">\n")              out.write("<div class=\"uml-implicit\">\n")
240              if (os.path.isfile(mputils._slashify(settings2['tmpdir'])\              if (os.path.isfile(mputils._slashify(settings['tmpdir'])\
241                                 +name+".gen.refers")):                                 +name+".gen.refers")):
242                  refers = open(mputils._slashify(settings2['tmpdir'])\                  refers = open(mputils._slashify(settings['tmpdir'])\
243                                 +name+".gen.refers").readlines()                                 +name+".gen.refers").readlines()
244                  out.write("<small><strong>"+name+"</strong>: \n")                  out.write("<small><strong>"+name+"</strong>: \n")
245                  for refer in refers:                  for refer in refers:
# Line 250  def embed_implicit(oldpath, name, path): Line 250  def embed_implicit(oldpath, name, path):
250    
251              out.write("<a id=\""+name+"\"></a>\n")              out.write("<a id=\""+name+"\"></a>\n")
252              out.write("<img "\              out.write("<img "\
253                        +"src=\""+mputils._slashify(settings2['to_tmpdir'])\                        +"src=\""+mputils._slashify(settings['to_tmpdir'])\
254                        +context_name+".gen.png"\                        +context_name+".gen.png"\
255                        +"\" usemap=\"#"+name+"\" alt=\""+name+"\" />\n")                        +"\" usemap=\"#"+name+"\" alt=\""+name+"\" />\n")
256              out.write("</div>\n")              out.write("</div>\n")
# Line 258  def embed_implicit(oldpath, name, path): Line 258  def embed_implicit(oldpath, name, path):
258              html = html[insert+5:len(html)]              html = html[insert+5:len(html)]
259              out.write(html)              out.write(html)
260              out.close()              out.close()
261    
262        settings.restore(settings2)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

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