gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] navidoc ./config.himalia ./config.py ./docutils...


From: Asko Soukka
Subject: [Gzz-commits] navidoc ./config.himalia ./config.py ./docutils...
Date: Thu, 10 Apr 2003 05:20:43 -0400

CVSROOT:        /cvsroot/navidoc
Module name:    navidoc
Changes by:     Asko Soukka <address@hidden>    03/04/10 05:20:43

Modified files:
        .              : config.himalia config.py docutils.conf 
                         docutils.himalia rst2any.py 
        navidoc/directives: __init__.py mp.py pegboard.py 
        navidoc/mp     : __init__.py 
        navidoc/writers: __init__.py latex2e.py 

Log message:
        make latex should work now

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/config.himalia.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/config.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/docutils.conf.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/docutils.himalia.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/rst2any.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/directives/__init__.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/directives/mp.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/directives/pegboard.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/mp/__init__.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/writers/__init__.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/writers/latex2e.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: navidoc/config.himalia
diff -u navidoc/config.himalia:1.3 navidoc/config.himalia:1.4
--- navidoc/config.himalia:1.3  Mon Apr  7 11:58:00 2003
+++ navidoc/config.himalia      Thu Apr 10 05:20:43 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: config.himalia,v 1.3 2003/04/07 15:58:00 humppake Exp $
+# $Id: config.himalia,v 1.4 2003/04/10 09:20:43 humppake Exp $
 
 __docformat__ = 'reStructuredText'
 
@@ -33,6 +33,7 @@
 
 # global settings needed all around
 mp_directory = '../ffdoc/diagrams'
+mp_generate = 1
 mp_eps_only = 0
 
 # global settings needed all around, these
Index: navidoc/config.py
diff -u navidoc/config.py:1.14 navidoc/config.py:1.15
--- navidoc/config.py:1.14      Mon Apr  7 11:58:00 2003
+++ navidoc/config.py   Thu Apr 10 05:20:43 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: config.py,v 1.14 2003/04/07 15:58:00 humppake Exp $
+# $Id: config.py,v 1.15 2003/04/10 09:20:43 humppake Exp $
 
 __docformat__ = 'reStructuredText'
 
@@ -33,6 +33,7 @@
 
 # global settings needed all around
 mp_directory = '../navidoc/diagrams'
+mp_generate = 1
 mp_eps_only = 0
 
 # global settings needed all around, these
Index: navidoc/docutils.conf
diff -u navidoc/docutils.conf:1.5 navidoc/docutils.conf:1.6
--- navidoc/docutils.conf:1.5   Fri Mar 28 04:49:57 2003
+++ navidoc/docutils.conf       Thu Apr 10 05:20:43 2003
@@ -1,11 +1,11 @@
-#$Id: docutils.conf,v 1.5 2003/03/28 09:49:57 humppake Exp $
+#$Id: docutils.conf,v 1.6 2003/04/10 09:20:43 humppake Exp $
 
 [options]
 
 # These entries affect all processing:
 output-encoding: iso-8859-1
 source-link: 1
-language: fi
+language: en
 datestamp: %c
 generator: 1
 
Index: navidoc/docutils.himalia
diff -u navidoc/docutils.himalia:1.1 navidoc/docutils.himalia:1.2
--- navidoc/docutils.himalia:1.1        Mon Apr  7 05:00:30 2003
+++ navidoc/docutils.himalia    Thu Apr 10 05:20:43 2003
@@ -1,11 +1,11 @@
-#$Id: docutils.himalia,v 1.1 2003/04/07 09:00:30 humppake Exp $
+#$Id: docutils.himalia,v 1.2 2003/04/10 09:20:43 humppake Exp $
 
 [options]
 
 # These entries affect all processing:
 output-encoding: iso-8859-1
 source-link: 1
-language: fi
+language: en
 datestamp: %c
 generator: 1
 
Index: navidoc/navidoc/directives/__init__.py
diff -u navidoc/navidoc/directives/__init__.py:1.6 
navidoc/navidoc/directives/__init__.py:1.7
--- navidoc/navidoc/directives/__init__.py:1.6  Tue Apr  1 08:54:09 2003
+++ navidoc/navidoc/directives/__init__.py      Thu Apr 10 05:20:43 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: __init__.py,v 1.6 2003/04/01 13:54:09 humppake Exp $
+# $Id: __init__.py,v 1.7 2003/04/10 09:20:43 humppake Exp $
 
 #
 # Written by Asko Soukka
@@ -33,6 +33,11 @@
 from latex import bibliography_directive
 from mp import mp_directive, uml_directive, uml_refer_directive
 
+align_values = ('top', 'middle', 'bottom', 'left', 'center', 'right')
+
+def align(argument):
+    return directives.choice(argument, align_values)
+
 directives._directives['pegboard'] = pegboard_directive
 directives._directives['mp'] = mp_directive
 directives._directives['uml'] = uml_directive
@@ -46,4 +51,3 @@
 images.image.options['width'] = directives.unchanged;
 images.image.options['label'] = directives.unchanged;
 images.image.options['environment'] = directives.unchanged;
-
Index: navidoc/navidoc/directives/mp.py
diff -u navidoc/navidoc/directives/mp.py:1.4 
navidoc/navidoc/directives/mp.py:1.5
--- navidoc/navidoc/directives/mp.py:1.4        Mon Apr  7 11:58:00 2003
+++ navidoc/navidoc/directives/mp.py    Thu Apr 10 05:20:43 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: mp.py,v 1.4 2003/04/07 15:58:00 humppake Exp $
+# $Id: mp.py,v 1.5 2003/04/10 09:20:43 humppake Exp $
 
 #
 # Written by Asko Soukka, Benja Fallenstein
@@ -64,12 +64,11 @@
         # already exists.
 
         mp_filename = slashify(config.mp_directory)+attributes['name']
-        if not eps_only: mp = open(mp_filename+'.gen.mp.3', 'w')
-        else: mp = open(mp_filename+'_gen.eps', 'w')
+        mp = open(mp_filename+'.gen.mp.3', 'w')
         mp.write(temp)
         mp.close()
 
-    if not eps_only: mp2png(attributes['name'])
+    if (config.mp_generate): mp2png(attributes['name'])
     
     return [mp_node]
 
@@ -134,7 +133,7 @@
         mp.write(files[1])
         mp.close()
 
-        create_uml(diagram)
+        if (config.mp_generate): create_uml(diagram)
 
     add_refer(attributes['name'], 1)
 
Index: navidoc/navidoc/directives/pegboard.py
diff -u navidoc/navidoc/directives/pegboard.py:1.14 
navidoc/navidoc/directives/pegboard.py:1.15
--- navidoc/navidoc/directives/pegboard.py:1.14 Mon Apr  7 11:58:00 2003
+++ navidoc/navidoc/directives/pegboard.py      Thu Apr 10 05:20:43 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: pegboard.py,v 1.14 2003/04/07 15:58:00 humppake Exp $
+# $Id: pegboard.py,v 1.15 2003/04/10 09:20:43 humppake Exp $
 
 #
 # Written by Benja Fallensten, Vesa Kaihlavirta, Asko Soukka
@@ -136,7 +136,7 @@
         rstfiles = [f for f in peg['files'] if f.endswith('.rst')]
 
         config.dbg.mute('docutils')
-        config.mp_eps_only = 1
+        config.mp_generate = 0
         for rstfile in rstfiles:
             config.input_filename = rstfile
             config.output_filename = ''
@@ -179,7 +179,7 @@
                 dbg_fail('PEG %s: Docutil raised an exception while converting 
%s. ' % (pegdir, rstfile))
                 dbg_fail('Conversion failed and HTML not created.\n')
         config.dbg.enable('docutils')
-        config.mp_eps_only = 0
+        config.mp_generate = 1
 
         if not peg['html']:
             for file in peg['files']:
Index: navidoc/navidoc/mp/__init__.py
diff -u navidoc/navidoc/mp/__init__.py:1.10 navidoc/navidoc/mp/__init__.py:1.11
--- navidoc/navidoc/mp/__init__.py:1.10 Mon Apr  7 11:58:00 2003
+++ navidoc/navidoc/mp/__init__.py      Thu Apr 10 05:20:43 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: __init__.py,v 1.10 2003/04/07 15:58:00 humppake Exp $
+# $Id: __init__.py,v 1.11 2003/04/10 09:20:43 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -84,10 +84,6 @@
     if len(extension) > 0: extension = '_'+extension
 
     dir = slashify(config.mp_directory)
-    if config.mp_eps_only:
-        eps = open(dir+diagram+extension+'_gen.eps', 'w')
-        eps.write(m.setup_code()+'\n')
-        return
 
     gen1 = open(dir+diagram+extension+'.gen.mp.1', 'w')
     gen1.write(m.setup_code()+'\n')
@@ -123,6 +119,11 @@
 
     dbg(syscmd)
     os.system('cd '+config.mp_directory+';'+syscmd)
+
+    if config.mp_eps_only:
+        os.rename(slashify(config.mp_directory)+diagram+'.gen.mp.1',
+                  slashify(config.mp_directory)+diagram+'_gen.eps')
+        return
 
     log = open(slashify(config.mp_directory)+diagram+'.gen.mp.log').read()
     if log.find("\n"+'!') != -1:
Index: navidoc/navidoc/writers/__init__.py
diff -u navidoc/navidoc/writers/__init__.py:1.3 
navidoc/navidoc/writers/__init__.py:1.4
--- navidoc/navidoc/writers/__init__.py:1.3     Tue Apr  1 08:54:10 2003
+++ navidoc/navidoc/writers/__init__.py Thu Apr 10 05:20:43 2003
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2003 Asko Soukka
+# Copyright (c) 2003 Asko Soukka, Benja Fallenstein
 # 
 # This file is part of Navidoc.
 # 
@@ -19,10 +19,10 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: __init__.py,v 1.3 2003/04/01 13:54:10 humppake Exp $
+# $Id: __init__.py,v 1.4 2003/04/10 09:20:43 humppake Exp $
 
 #
-# Written by Asko Soukka
+# Written by Asko Soukka, Benja Fallenstein
 #
 
 __docformat__ = 'reStructuredText'
@@ -34,8 +34,9 @@
 
 _writer_modules = {}
 _writer_aliases['latex'] = 'latex2e'
-_writer_modules['latex'] = 'navidoc.writers'
+_writer_modules['latex2e'] = 'navidoc.writers'
 
+# Replacing existing: Allows writers from different modules
 def get_writer_class(writer_name):
     """Return the Writer class from the `writer_name` module."""
     writer_name = writer_name.lower()
@@ -44,7 +45,53 @@
     if _writer_modules.has_key(writer_name):
         writer_module = _writer_modules[writer_name]
     else: writer_module = 'docutils.writers'
-    module = __import__(writer_name, globals(), locals(), writer_module)
+    module = __import__(writer_module, globals(), locals(), [writer_name])
+    module = getattr(module, writer_name)
     return module.Writer
 
 docutils.writers.get_writer_class = get_writer_class
+
+# Replacing existing: Avoiding "unknown target" warnings with latex writer
+# ***ugly***
+import docutils.transforms.universal, docutils.nodes
+class FinalCheckVisitor(docutils.transforms.universal.FinalCheckVisitor):
+    def visit_citation_reference(self, node):
+        if node.resolved or not node.hasattr('refname'):
+            return
+        refname = node['refname']
+        id = self.document.nameids.get(refname)
+        if id is None:
+            # Instead of complaining when a reference is not included
+            # (i.e., there's no '.. [gzz] bla' for a '[gzz]_'),
+            # we insert the missing node, empty.
+
+            # Note: I don't really know what I'm doing here,
+            # just poking around and guessing which variables
+            # contain which things...
+
+            id = refname
+            xnode = docutils.nodes.reference(refid=refname)
+            #node += xnode
+            self.document.ids[id] = xnode
+            self.document.nameids[refname] = refname
+
+        del node['refname']
+        node['refid'] = id
+        self.document.ids[id].referenced = 1
+        node.resolved = 1
+            
+        ##    msg = self.document.reporter.error(
+        ##          'Unknown target name: "%s".' % (node['refname']),
+        ##          base_node=node)
+        ##    msgid = self.document.set_id(msg)
+        ##    prb = nodes.problematic(
+        ##          node.rawsource, node.rawsource, refid=msgid)
+        ##    prbid = self.document.set_id(prb)
+        ##    msg.add_backref(prbid)
+        ##    node.parent.replace(node, prb)
+        ##else:
+        ##    del node['refname']
+        ##    node['refid'] = id
+        ##    self.document.ids[id].referenced = 1
+        ##    node.resolved = 1
+docutils.transforms.universal.FinalCheckVisitor = FinalCheckVisitor
Index: navidoc/navidoc/writers/latex2e.py
diff -u navidoc/navidoc/writers/latex2e.py:1.1 
navidoc/navidoc/writers/latex2e.py:1.2
--- navidoc/navidoc/writers/latex2e.py:1.1      Wed Mar 26 10:36:17 2003
+++ navidoc/navidoc/writers/latex2e.py  Thu Apr 10 05:20:43 2003
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2003 Janne Kujala, Asko Soukka
+# Copyright (c) 2003 Janne Kujala, Asko Soukka, Benja Fallenstein, Vesa 
Kaihlavirta
 # 
 # This file is part of Navidoc.
 # 
@@ -19,20 +19,17 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: latex2e.py,v 1.1 2003/03/26 15:36:17 humppake Exp $
+# $Id: latex2e.py,v 1.2 2003/04/10 09:20:43 humppake Exp $
 
 #
-# Written by Janne Kujala, Asko Soukka
+# Modified by Janne Kujala, Asko Soukka, Benja Fallenstein, Vesa Kaihlavirta
 #
 
 """
-This is a modified version of Engelbert Grubers original LaTeX2e
-document tree writer for Docutils:
-
 :Author: Engelbert Gruber (hacked by the Gzz project)
 :Contact: address@hidden
-:Revision: $Revision: 1.1 $
-:Date: $Date: 2003/03/26 15:36:17 $
+:Revision: $Revision: 1.2 $
+:Date: $Date: 2003/04/10 09:20:43 $
 :Copyright: This module has been placed in the public domain.
 
 LaTeX2e document tree Writer.
@@ -548,11 +545,11 @@
     def depart_date(self, node):
         self.depart_docinfo_item(node)
 
-#    def visit_decoration(self, node):
-#        pass
+    def visit_decoration(self, node):
+        pass
 
-#    def depart_decoration(self, node):
-#        pass
+    def depart_decoration(self, node):
+        pass
 
     def visit_definition(self, node):
         self.body.append('%[visit_definition]\n')
Index: navidoc/rst2any.py
diff -u navidoc/rst2any.py:1.19 navidoc/rst2any.py:1.20
--- navidoc/rst2any.py:1.19     Mon Apr  7 11:58:00 2003
+++ navidoc/rst2any.py  Thu Apr 10 05:20:43 2003
@@ -21,7 +21,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: rst2any.py,v 1.19 2003/04/07 15:58:00 humppake Exp $
+#$Id: rst2any.py,v 1.20 2003/04/10 09:20:43 humppake Exp $
 
 #
 # Written by Asko Soukka
@@ -35,7 +35,7 @@
 import docutils.core
 
 import navidoc.directives
-#import navidoc.writers
+import navidoc.writers
 import navidoc.modules
 
 from navidoc.util.path import *




reply via email to

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