gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./Makefile doc/.cvsignore doc/uml/frontend....


From: Asko Soukka
Subject: [Gzz-commits] gzz ./Makefile doc/.cvsignore doc/uml/frontend....
Date: Wed, 18 Dec 2002 10:56:12 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/12/18 10:56:09

Modified files:
        .              : Makefile 
        doc            : .cvsignore 
        doc/uml        : frontend.uml gfx.uml view.uml 
        metacode       : pegboard.py umldoc.py umlrst.py umltool.py 

Log message:
        documl... (to be continue)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Makefile.diff?tr1=1.224&tr2=1.225&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/.cvsignore.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/uml/frontend.uml.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/uml/gfx.uml.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/uml/view.uml.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/pegboard.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umldoc.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.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umltool.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: gzz/Makefile
diff -u gzz/Makefile:1.224 gzz/Makefile:1.225
--- gzz/Makefile:1.224  Wed Dec 18 06:38:14 2002
+++ gzz/Makefile        Wed Dec 18 10:56:09 2002
@@ -296,8 +296,10 @@
        javadoc $(JAVADOCOPTS) -d doc/javadoc -sourcepath . $(DOCPKGS)
 
 documl:
-       $(MAKE) -C doc/uml
-       $(MAKE) -C doc/uml/gl
+#      $(MAKE) -C doc/uml
+#      $(MAKE) -C doc/uml/gl
+       $(JYTHON) metacode/umldoc.py doc/
+       $(JYTHON) metacode/umlpegboard.py
 
 umldoc:
        $(JYTHON) metacode/umldoc.py $(INPUT)
Index: gzz/doc/.cvsignore
diff -u gzz/doc/.cvsignore:1.2 gzz/doc/.cvsignore:1.3
--- gzz/doc/.cvsignore:1.2      Mon Aug 19 15:02:07 2002
+++ gzz/doc/.cvsignore  Wed Dec 18 10:56:09 2002
@@ -1,2 +1,3 @@
 javadoc
 docxx
+*.gen.html
Index: gzz/doc/uml/frontend.uml
diff -u gzz/doc/uml/frontend.uml:1.7 gzz/doc/uml/frontend.uml:1.8
--- gzz/doc/uml/frontend.uml:1.7        Wed Dec  4 10:50:40 2002
+++ gzz/doc/uml/frontend.uml    Wed Dec 18 10:56:09 2002
@@ -7,12 +7,12 @@
 
 package View
     jlink
-       ../Gzz_Frontend_View.html
+       Gzz_Frontend_View.gen.html
     use Vobs
 
 package Vobs
     jlink
-       ../Gzz_Frontend_Vobs.html
+       Gzz_Frontend_Vobs.gen.html
     use GLRenderables
 
 package gzz.client.gl
@@ -24,5 +24,5 @@
 
 package GLRenderables
     jlink
-       ../Gzz_Frontend_GLRend.html
+       Gzz_Frontend_GLRend.gen.html
 
Index: gzz/doc/uml/gfx.uml
diff -u gzz/doc/uml/gfx.uml:1.1 gzz/doc/uml/gfx.uml:1.2
--- gzz/doc/uml/gfx.uml:1.1     Tue Aug 20 05:58:07 2002
+++ gzz/doc/uml/gfx.uml Wed Dec 18 10:56:09 2002
@@ -8,16 +8,16 @@
 
 package libCallGL
     jlink
-       ../Gzz_GL.html#libCallGL
+       Gzz_GL.gen.html#libcallgl
 package libTexture
     jlink
-       ../Gzz_GL.html#libTexture
+       Gzz_GL.gen.html#libtexture
     use Perlin.hxx
     use Vec.hxx
 
 package libPaper
     jlink
-       ../Gzz_GL.html#libPaper
+       Gzz_GL.gen.html#libpaper
     use libCallGL
     use libTexture
 
Index: gzz/doc/uml/view.uml
diff -u gzz/doc/uml/view.uml:1.3 gzz/doc/uml/view.uml:1.4
--- gzz/doc/uml/view.uml:1.3    Wed Dec  4 10:54:19 2002
+++ gzz/doc/uml/view.uml        Wed Dec 18 10:56:09 2002
@@ -6,7 +6,7 @@
 
 package Vobs
        jlink
-               ../Gzz_Frontend_Vobs.html
+               Gzz_Frontend_Vobs.gen.html
 
 bigpackage gzz.view
 
Index: gzz/metacode/pegboard.py
diff -u gzz/metacode/pegboard.py:1.25 gzz/metacode/pegboard.py:1.26
--- gzz/metacode/pegboard.py:1.25       Wed Dec 18 06:36:53 2002
+++ gzz/metacode/pegboard.py    Wed Dec 18 10:56:09 2002
@@ -201,13 +201,6 @@
             fails += 'PEG %s: Docutil raised an exception while converting %s. 
' % (pegdir, rstfile)
             fails += 'Conversion failed and HTML not created.\n'
 
-    #########################
-    #UMLDOC: the second pass#
-    #########################
-    for rstfile in rstfiles:
-        file = pegroot+'/'+pegdir+'/'+rstfile
-        umlrst.embed_diagram(file)
-
     if not peg['html']:
         for file in peg['files']:
             if file[len(file)-5:len(file)] == '.html':
Index: gzz/metacode/umldoc.py
diff -u gzz/metacode/umldoc.py:1.6 gzz/metacode/umldoc.py:1.7
--- gzz/metacode/umldoc.py:1.6  Wed Dec 18 06:36:53 2002
+++ gzz/metacode/umldoc.py      Wed Dec 18 10:56:09 2002
@@ -23,25 +23,53 @@
 
 umltool.settings['css'] = 'doc/gzz.css'
 
-def run(path):
+def run_convert(path):
     umltool.set_to_root(path)
     
     if os.path.isdir(path):
-        if not path.endswith("/"): umltool.settings['to_root'] += "../"        
+        umltool.set_to_root((path+"/").replace("//", "/"))
+        files = [f for f in os.listdir(path+'/') \
+               if os.path.isfile(path+'/'+f) and not f.startswith('.')
+                  and '#' not in f and '~' not in f]
+        rstfiles = [f for f in files if f.endswith('.rst')]
+
+        for rstfile in rstfiles:
+            rst2html(path+"/"+rstfile)
 
     elif os.path.isfile(path) or os.path.isfile(path+'.rst'):
         rst2html(path)
-        umlrst.embed_diagram(path)
 
     else:
         umltool.run(path)
 
+def run_embed(path):
+    umltool.set_to_root(path)
+    
+    if os.path.isdir(path):
+        umltool.set_to_root((path+"/").replace("//", "/"))
+        files = [f for f in os.listdir(path+'/') \
+               if os.path.isfile(path+'/'+f) and not f.startswith('.')
+                  and '#' not in f and '~' not in f]
+        rstfiles = [f for f in files if f.endswith('.rst')]
+
+        for rstfile in rstfiles:
+            umlrst.embed_diagram(path+"/"+rstfile)
+
+    elif os.path.isfile(path) or os.path.isfile(path+'.rst'):
+        umlrst.embed_diagram(path)
+
 def rst2html(path):
     #the first pass - converts rst into html
     if path.endswith(".rst"): path = path[0:len(path)-4]
-    args = '-stg --stylesheet '+umltool.settings['to_root']\
-           +umltool.settings['css']+' '+path+'.rst '+path+'.gen.html'
+    args = '-stg --stylesheet '+umltool.settings['to_css']\
+           +' '+path+'.rst '+path+'.gen.html'
     docutils.core.publish_cmdline(writer_name='html', argv=args.split())
 
+
+#the first pass, create all diagrams data
+for path in sys.argv[1:]:
+    run_convert(path)
+
+#the second pass, generate and embed diagrams
 for path in sys.argv[1:]:
-    run(path)
+    run_embed(path)
Index: gzz/metacode/umlrst.py
diff -u gzz/metacode/umlrst.py:1.5 gzz/metacode/umlrst.py:1.6
--- gzz/metacode/umlrst.py:1.5  Wed Dec 18 06:36:53 2002
+++ gzz/metacode/umlrst.py      Wed Dec 18 10:56:09 2002
@@ -85,8 +85,7 @@
         Returns a comment node with name of the diagram.
     """
     attributes = {'name': arguments[0]}
-    if content:
-        uml_node = docutils.nodes.comment('', 'UML:'+attributes['name'])
+    uml_node =  docutils.nodes.comment('', 'UML:'+attributes['name'])
         
     return [uml_node]
 
@@ -118,19 +117,22 @@
             if 
(os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.uml")):
                 prefix = name + ".gen"
             else: prefix = name
-            assert 
os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".uml")\
-                   and 
os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".mp")
+            assert 
(os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".uml")\
+                   and 
os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".mp")),\
+                   "file "+ prefix+".uml or "+prefix+".mp not found"
+            print "Embedding %s into %s" % (name, path)
             create_diagram(prefix)
-            assert 
os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".html")\
-                   and 
os.path.isfile(umltool.settings['tmpdir']+"/"+prefix+".png")
+            assert 
(os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.html")\
+                   and 
os.path.isfile(umltool.settings['tmpdir']+"/"+name+".gen.png")),\
+                   "file "+name+".gen.html or "+name+".gen.png not found"
 
             #Cut&Pastes imagemap into html
-            imgmap = open(umltool.settings['tmpdir']+"/"+prefix+".html").read()
+            imgmap = 
open(umltool.settings['tmpdir']+"/"+name+".gen.html").read()
             out.write("<map name=\""+name+"\">\n")
             out.write(imgmap[imgmap.find('>',imgmap.find('<map'))+1:\
                              imgmap.find('</map>')])
             out.write("</map>\n")
-            out.write("<img 
src=\""+umltool.settings['to_tmpdir']+"/"+prefix+".png"\
+            out.write("<img 
src=\""+umltool.settings['to_tmpdir']+"/"+name+".gen.png"\
                       +"\" usemap=\""+name+"\"/>")
             html = html[html.find("-->", insert)+3:len(html)]
             insert = html.find("<!-- UML:")
Index: gzz/metacode/umltool.py
diff -u gzz/metacode/umltool.py:1.4 gzz/metacode/umltool.py:1.5
--- gzz/metacode/umltool.py:1.4 Wed Dec 18 06:36:53 2002
+++ gzz/metacode/umltool.py     Wed Dec 18 10:56:09 2002
@@ -34,6 +34,8 @@
     settings['to_javadoc'] = merge_paths(path, settings['javadoc'])
     if settings.has_key('tmpdir'):
         settings['to_tmpdir'] = merge_paths(path, settings['tmpdir'])
+    if settings.has_key('css'):
+        settings['to_css'] = merge_paths(path, settings['css'])
         
 def merge_paths(fromd, to):
     depth = fromd.count("/")



reply via email to

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