gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/metacode mputils.py umlrst.py


From: Vesa Kaihlavirta
Subject: [Gzz-commits] gzz/metacode mputils.py umlrst.py
Date: Mon, 03 Feb 2003 05:30:03 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Vesa Kaihlavirta <address@hidden>       03/02/03 05:30:00

Modified files:
        metacode       : mputils.py umlrst.py 

Log message:
        Wrestling against globals

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/mputils.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umlrst.py.diff?tr1=1.21&tr2=1.22&r1=text&r2=text

Patches:
Index: gzz/metacode/mputils.py
diff -u gzz/metacode/mputils.py:1.6 gzz/metacode/mputils.py:1.7
--- gzz/metacode/mputils.py:1.6 Mon Feb  3 05:15:31 2003
+++ gzz/metacode/mputils.py     Mon Feb  3 05:30:00 2003
@@ -44,10 +44,13 @@
     def has_key(self, name):
         return self.dict.has_key(name)
 
-    def resist(self):
+    def copy(self):
         '''Resistance is futile, but we resist anyway. Returns a 
         non-borgified list.'''
         return self.dict.copy()
+
+    def restore(self, l):
+        self.dict=l
 
 """
 Stores global settings for metapost actions.
Index: gzz/metacode/umlrst.py
diff -u gzz/metacode/umlrst.py:1.21 gzz/metacode/umlrst.py:1.22
--- gzz/metacode/umlrst.py:1.21 Mon Feb  3 05:15:31 2003
+++ gzz/metacode/umlrst.py      Mon Feb  3 05:30:00 2003
@@ -194,13 +194,13 @@
         if slash != -1:
             path = (oldpath[0:slash+1] + path).replace("//", "/")
 
-    settings2 = settings.resist()
+    settings2 = settings.copy()
 
     umltool.set_transition_paths(path)
     slash = oldpath.rfind("/")
     if slash != -1:
-        settings2['to_context'] = mputils.transition_path(path, 
oldpath[0:slash])
-    else: settings2['to_context'] = mputils.transition_path(path, oldpath)
+        settings['to_context'] = mputils.transition_path(path, 
oldpath[0:slash])
+    else: settings['to_context'] = mputils.transition_path(path, oldpath)
 
     #the second pass - adds uml into html
     if path.endswith(".rst"): path = path[0:len(path)-4]
@@ -217,7 +217,7 @@
 
             #This should work also with non-generated UML-diagrams. Checks 
first
             #for generated and then if non-generated diagram exists.
-            if (os.path.isfile(mputils._slashify(settings2['tmpdir'])\
+            if (os.path.isfile(mputils._slashify(settings['tmpdir'])\
                                +name+".gen.uml")):
                 old_prefix = name + ".gen"
             else: old_prefix = name
@@ -230,16 +230,16 @@
             create_diagram(old_prefix, context_name, 0.5)
         
             #Cut&Pastes imagemap into html
-            imgmap = open(mputils._slashify(settings2['tmpdir'])\
+            imgmap = open(mputils._slashify(settings['tmpdir'])\
                           +context_name+".gen.html").read()
             out.write("<map id=\""+name+"\" name=\""+name+"\">\n")
             out.write(imgmap[imgmap.find('>',imgmap.find('<map'))+1:\
                              imgmap.find('</map>')])
             out.write("</map>\n")
             out.write("<div class=\"uml-implicit\">\n")
-            if (os.path.isfile(mputils._slashify(settings2['tmpdir'])\
+            if (os.path.isfile(mputils._slashify(settings['tmpdir'])\
                                +name+".gen.refers")):
-                refers = open(mputils._slashify(settings2['tmpdir'])\
+                refers = open(mputils._slashify(settings['tmpdir'])\
                                +name+".gen.refers").readlines()
                 out.write("<small><strong>"+name+"</strong>: \n")
                 for refer in refers:
@@ -250,7 +250,7 @@
 
             out.write("<a id=\""+name+"\"></a>\n")
             out.write("<img "\
-                      +"src=\""+mputils._slashify(settings2['to_tmpdir'])\
+                      +"src=\""+mputils._slashify(settings['to_tmpdir'])\
                       +context_name+".gen.png"\
                       +"\" usemap=\"#"+name+"\" alt=\""+name+"\" />\n")
             out.write("</div>\n")
@@ -258,3 +258,5 @@
             html = html[insert+5:len(html)]
             out.write(html)
             out.close()
+
+    settings.restore(settings2)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]