gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] navidoc ./TODO-navidoc ./config.himalia ./confi...


From: Asko Soukka
Subject: [Gzz-commits] navidoc ./TODO-navidoc ./config.himalia ./confi...
Date: Thu, 22 May 2003 06:52:21 -0400

CVSROOT:        /cvsroot/navidoc
Module name:    navidoc
Changes by:     Asko Soukka <address@hidden>    03/05/22 06:52:21

Modified files:
        .              : TODO-navidoc config.himalia config.py 
                         rst2any.py 
        navidoc/directives: mp.py pegboard.py 
        navidoc/link   : __init__.py 
        navidoc/modules: imagemap.py navbar.py texture.py 
        navidoc/mp     : __init__.py 

Log message:
        '.gen' ton an option

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/TODO-navidoc.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/config.himalia.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/config.py.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/rst2any.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/directives/mp.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/directives/pegboard.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/link/__init__.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/modules/imagemap.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/modules/navbar.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/modules/texture.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/mp/__init__.py.diff?tr1=1.28&tr2=1.29&r1=text&r2=text

Patches:
Index: navidoc/TODO-navidoc
diff -u navidoc/TODO-navidoc:1.13 navidoc/TODO-navidoc:1.14
--- navidoc/TODO-navidoc:1.13   Wed May 21 05:34:45 2003
+++ navidoc/TODO-navidoc        Thu May 22 06:52:19 2003
@@ -6,17 +6,6 @@
 =================================
 
 humppake:
-  - normal link between projects like::
-       
-       link fenfire
-               doc/foo/foo.gen.html
-       
-       link navidoc
-               doc/foo/foo.gen.html
-       
-  - ".gen." midfix to be optional:
-    + replacing ".gen" with global attribute
-    + replacing some foo[a:b] with foo[a:len(midfix)+c]
   - syntax to follow Fenfire coding standards
   - NavBar update for gzz.css
   - features for NavBar to work better with himalia doc
Index: navidoc/config.himalia
diff -u navidoc/config.himalia:1.16 navidoc/config.himalia:1.17
--- navidoc/config.himalia:1.16 Thu May 22 05:25:50 2003
+++ navidoc/config.himalia      Thu May 22 06:52:20 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: config.himalia,v 1.16 2003/05/22 09:25:50 humppake Exp $
+# $Id: config.himalia,v 1.17 2003/05/22 10:52:20 humppake Exp $
 
 __docformat__ = 'reStructuredText'
 
@@ -33,6 +33,10 @@
 
 # base_url
 base_rul = 'http://fenfire.org/'
+
+# midfix for generated files
+# don't change this, if you don't know what you are doing :)
+midfix = ".gen"
 
 # global settings needed all around
 mp_directory = '../ffdoc/diagrams'
Index: navidoc/config.py
diff -u navidoc/config.py:1.27 navidoc/config.py:1.28
--- navidoc/config.py:1.27      Thu May 22 05:25:50 2003
+++ navidoc/config.py   Thu May 22 06:52:20 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: config.py,v 1.27 2003/05/22 09:25:50 humppake Exp $
+# $Id: config.py,v 1.28 2003/05/22 10:52:20 humppake Exp $
 
 __docformat__ = 'reStructuredText'
 
@@ -30,6 +30,10 @@
 #Environmental variable MPINPUTS should be relative to tmpdir,
 #or be an absolute path.
 os.putenv("MPINPUTS", "../navidoc/mp/")
+
+# midfix for generated files
+# don't change this, if you don't know what you are doing :)
+midfix = ".gen"
 
 # base_url
 base_url = 'http://fenfire.org/'
Index: navidoc/navidoc/directives/mp.py
diff -u navidoc/navidoc/directives/mp.py:1.7 
navidoc/navidoc/directives/mp.py:1.8
--- navidoc/navidoc/directives/mp.py:1.7        Tue May 20 06:55:42 2003
+++ navidoc/navidoc/directives/mp.py    Thu May 22 06:52:20 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: mp.py,v 1.7 2003/05/20 10:55:42 humppake Exp $
+# $Id: mp.py,v 1.8 2003/05/22 10:52:20 humppake Exp $
 
 #
 # Written by Asko Soukka, Benja Fallenstein
@@ -50,7 +50,7 @@
 
     attributes = {'name': arguments[0]}
     options['uri'] = slashify(to_tmpdir)+attributes['name']
-    if not eps_only: options['uri'] += '.gen.png'
+    if not eps_only: options['uri'] += config.midfix+'.png'
     else: options['uri'] += '_gen.eps'
     options['alt'] = attributes['name']
     options['title'] = attributes['name']
@@ -64,7 +64,7 @@
         # already exists.
 
         mp_filename = slashify(config.mp_directory)+attributes['name']
-        mp = open(mp_filename+'.gen.mp.3', 'w')
+        mp = open(mp_filename+config.midfix+'.mp.3', 'w')
         mp.write(temp)
         mp.close()
 
@@ -89,7 +89,7 @@
 
     attributes = {'name': arguments[0]}
     src = slashify(to_tmpdir)+attributes['name']
-    if not eps_only: src += '.gen.png'
+    if not eps_only: src += config.midfix+'.png'
     else: src += '_gen.eps'
 
     options['uri'] = src
@@ -125,11 +125,11 @@
         dir = slashify(config.mp_directory)
         diagram = attributes['name']
 
-        uml_file = open(dir+diagram+'.gen.uml', 'w')
+        uml_file = open(dir+diagram+config.midfix+'.uml', 'w')
         uml_file.write(files[0])
         uml_file.close()
     
-        mp = open(dir+diagram+'.gen.mp', 'w')
+        mp = open(dir+diagram+config.midfix+'.mp', 'w')
         mp.write(files[1])
         mp.close()
 
@@ -160,7 +160,7 @@
 
     attributes = {'name': arguments[0]}
     src = slashify(to_tmpdir)+attributes['name']
-    if not eps_only: src += '.gen.png'
+    if not eps_only: src += config.midfix+'.png'
     else: src += '_gen.eps'
 
     uml_node =  docutils.nodes.image(_uml=attributes['name'], uri=src)
@@ -181,7 +181,7 @@
     Add reference information for a spesific diagram.
     """
     refer = slashify(config.working_directory)+config.output_filename
-    refers_filepath = slashify(config.mp_directory)+diagram+".gen.refers"
+    refers_filepath = 
slashify(config.mp_directory)+diagram+config.midfix+".refers"
     if (os.path.isfile(refers_filepath)):
         old_refers = open(refers_filepath, "r").read()
         if old_refers.find(config.output_filename) == -1:
Index: navidoc/navidoc/directives/pegboard.py
diff -u navidoc/navidoc/directives/pegboard.py:1.19 
navidoc/navidoc/directives/pegboard.py:1.20
--- navidoc/navidoc/directives/pegboard.py:1.19 Tue Apr 29 05:14:22 2003
+++ navidoc/navidoc/directives/pegboard.py      Thu May 22 06:52:20 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: pegboard.py,v 1.19 2003/04/29 09:14:22 humppake Exp $
+# $Id: pegboard.py,v 1.20 2003/05/22 10:52:20 humppake Exp $
 
 #
 # Written by Benja Fallensten, Vesa Kaihlavirta, Asko Soukka
@@ -139,7 +139,7 @@
         config.mp_generate = 0
         for rstfile in rstfiles:
             config.input_filename = rstfile
-            config.output_filename = rstfile[0:len(rstfile)-4]+'.gen.html'
+            config.output_filename = 
rstfile[0:len(rstfile)-4]+config.midfix+'.html'
             pub = Publisher()
             pub.set_reader('standalone', None, 'restructuredtext')
             filename = slashify(config.working_directory)+rstfile
@@ -155,7 +155,7 @@
                 #conversion have succeeded so far, parsing peg's metadata
                 #from its document tree
                 if rstfile == peg['rst']:
-                    peg['html'] = rstfile[0:len(rstfile)-4]+'.gen.html'
+                    peg['html'] = 
rstfile[0:len(rstfile)-4]+config.midfix+'.html'
                     peg['topic'] = getTagValue(document, 'title', always_raw=1)
                     peg['topic'] = peg['topic']
                     peg['last-modified'] = getFieldTagValue(document, 
'last-modified')
Index: navidoc/navidoc/link/__init__.py
diff -u navidoc/navidoc/link/__init__.py:1.15 
navidoc/navidoc/link/__init__.py:1.16
--- navidoc/navidoc/link/__init__.py:1.15       Tue May 20 07:16:08 2003
+++ navidoc/navidoc/link/__init__.py    Thu May 22 06:52:21 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: __init__.py,v 1.15 2003/05/20 11:16:08 humppake Exp $
+#$Id: __init__.py,v 1.16 2003/05/22 10:52:21 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -121,84 +121,3 @@
         This should be overwritten elsewhere.
         """
         return ''
-   
-#        if jlink != None:
-#             #trimming jlink to comparable
-#             name = jlink
-#             if name.rfind("#") != -1:
-#                 name = name[0:name.rfind("#")]
-#             if name.endswith(".html"): name = name[0:len(name)-5]
-#             if name.endswith(".gen"): name = name[0:len(name)-4]
-#             #Marking "Broken link" if file not found
-#             if settings.has_key('path'):
-#                slash = settings['path'].rfind("/")
-#                if slash != -1:
-#                    path = (settings['path'][0:slash+1] + 
target(jlink)).replace("//", "/")
-#                else:
-#                    path = target(jlink).replace("//", "/")
-#                if path.rfind("#") != -1:
-#                    path = path[0:path.rfind("#")]
-#                if not os.path.isfile(path):
-#     #               print path
-#                     return 'showlinkerror("'+jlink+'", ('+box+'));'
-#                else:
-#                     file = open(path)                
-#                     title = re.compile('<title>([^<]*)</title>')
-#                     title = title.findall(file.read())
-#                     file.close()
-#                     if len(title) > 0: title = title[0]
-#                     else: title = jlink
-#                     titles[jlink] = title#
-
-#             """ If focus is set and 'focus' matches, focus jlink. """
-#             #comparing
-#             if settings.has_key('focus') and (\
-#                settings['focus'].find("_"+name.replace(".", "_")+".") != -1 
or \
-#                settings['focus'].find("_"+name.replace(".", "_")+"_package") 
!= -1):
-#                 if RoughEdge: return 'showfocus("'+jlink+'", 
('+box+'));'+"\n"+'drawRoughEdge(('+box+'));'
-#                 else: return 'showfocus("'+jlink+'", ('+box+'));'
-#             return 'showjlink("'+jlink+'", ('+box+'));'
-#         return ""
-         
-#         """Returns target file of the jlink with
-#         path from the current directory."""
-#         ts = jlink.split(".")
-#         if re.search("html", ts[-1]):
-#             settings2 = settings.copy()
-#             if settings.has_key('path') and settings.has_key('tmpdir') \
-#                    and settings.has_key('name'):
-#                 if 
(os.path.isfile(mputils.slashify(settings['tmpdir'])+settings['name']+".gen.refers")):
-#                     refer_file = 
open(mputils.slashify(settings['tmpdir'])+settings['name']\
-#                                       +".gen.refers", "r")
-#                     #print "NEEDLE:", ts[-3].split("/")[-1]
-#                     refers = refer_file.readlines()
-#                     if len(refers) > 0 and \
-#                            "".join([refer for refer in 
refers]).find(ts[-3].split("/")[-1]) == -1:
-#                         tmp = mputils.transition_path(settings['path'], 
refers[0].replace(".rst", ".gen.html"))
-#                         slash = tmp.rfind("/")
-#                         if slash != -1:
-#                             settings['to_context'] = 
(tmp[0:slash+1]).replace("//", "/")
-#                             #print "REFERS:",refers
-#                             #print "PATH:", settings['path']
-#                             #print "JLINK:",jlink
-#                             #print "TO_CONTEXT:", settings['to_context']
-#                     refer_file.close()
-#             if settings.has_key('to_context') and not \
-#                 jlink.startswith(settings['to_context']):
-#                 if settings['to_context'].endswith("/"):
-#                     target = settings['to_context']+jlink
-#                 else:
-#                     target = settings['to_context']+"/"+jlink
-#                 while target.startswith("/"):
-#                     target = target[1:len(target)]
-#             else: target = jlink
-#             settings.restore(settings2)
-#         elif re.match("^[a-z]", ts[-1]):
-#             target = (settings['to_javadoc']+"/"\
-#                       +"/".join(ts) 
-#                       + "/package-summary.html#package_description")
-#         else:
-#             target = (settings['to_javadoc']+"/"\
-#                       +"/".join(ts)
-#                       + ".html")
-#         return target
Index: navidoc/navidoc/modules/imagemap.py
diff -u navidoc/navidoc/modules/imagemap.py:1.6 
navidoc/navidoc/modules/imagemap.py:1.7
--- navidoc/navidoc/modules/imagemap.py:1.6     Wed May 21 05:32:56 2003
+++ navidoc/navidoc/modules/imagemap.py Thu May 22 06:52:21 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: imagemap.py,v 1.6 2003/05/21 09:32:56 humppake Exp $
+#$Id: imagemap.py,v 1.7 2003/05/22 10:52:21 humppake Exp $
 
 #
 # Written by Asko Soukka
@@ -69,7 +69,8 @@
         diagram = html[insert+11:html.find('"', insert+11)]
         
         context = filepath.replace("/","_")
-        if context.endswith(".gen.html"): context = context[0:len(context)-9]
+        if context.endswith(config.midfix+'.html'):
+            context = context[0:len(context)-(len(config.midfix)+5)]
         if context.endswith(".html"): context = context[0:len(context)-5]
 
         out = open(filepath, "w")            
@@ -141,7 +142,8 @@
     
     if insert != -1 and explicit == -1:
         context = filepath.replace("/","_")
-        if context.endswith(".gen.html"): context = context[0:len(context)-9]
+        if context.endswith(config.midfix+'.html'):
+            context = context[0:len(context)-(len(config.midfix)+5)]
         if context.endswith(".html"): context = context[0:len(context)-5]
         context = context+'_implicit'
 
@@ -166,7 +168,7 @@
     config.link_base_directory = None
 
 def is_linked(diagram):
-    log = open(slashify(config.mp_directory)+diagram+'.gen.mp.log').read()  
+    log = 
open(slashify(config.mp_directory)+diagram+config.midfix+'.mp.log').read()  
     log = log.replace("\n",'') # MetaPost (mpost) splits lines awkwardly in 
the log.
     
     # Grep all linked areas from log file.
@@ -179,7 +181,7 @@
 def get_imagemap(diagram, context, scale=1.0, id_postfix=''):
     if len(context) > 0: context = '_'+context
 
-    log = 
open(slashify(config.mp_directory)+diagram+context+'.gen.mp.log').read()  
+    log = 
open(slashify(config.mp_directory)+diagram+context+config.midfix+'.mp.log').read()
  
     log = log.replace("\n",'') # MetaPost (mpost) splits lines awkwardly in 
the log.
     
     links = []
@@ -204,7 +206,7 @@
                  +"\n".join([link.imgmapanchor(scale) for link in links]) \
                  +'</map>'+"\n" \
                  +'<img 
src="'+slashify(relative_path(config.working_directory, config.mp_directory)) \
-                 +diagram+context+'.gen.png" 
usemap="#'+diagram+id_postfix+'_map" alt="'+diagram+id_postfix+'" />'+"\n"
+                 +diagram+context+config.midfix+'.png" 
usemap="#'+diagram+id_postfix+'_map" alt="'+diagram+id_postfix+'" />'+"\n"
 
     return imgmap
 
@@ -215,7 +217,7 @@
     """
     targets = []
 
-    log = open(slashify(config.mp_directory)+diagram+'.gen.mp.log').read()  
+    log = 
open(slashify(config.mp_directory)+diagram+config.midfix+'.mp.log').read()  
     log = log.replace("\n",'') # MetaPost (mpost) splits lines awkwardly in 
the log.
 
     # Grep all linked areas from log file.
Index: navidoc/navidoc/modules/navbar.py
diff -u navidoc/navidoc/modules/navbar.py:1.12 
navidoc/navidoc/modules/navbar.py:1.13
--- navidoc/navidoc/modules/navbar.py:1.12      Tue Apr 29 04:55:08 2003
+++ navidoc/navidoc/modules/navbar.py   Thu May 22 06:52:21 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: navbar.py,v 1.12 2003/04/29 08:55:08 tuukkah Exp $
+#$Id: navbar.py,v 1.13 2003/05/22 10:52:21 humppake Exp $
 
 #
 # Written by Benja Fallenstein
@@ -67,8 +67,8 @@
 
         name = match.group(1)
         
-        if os.path.basename(filename) in ('index.html',
-                                          'peg.gen.html'):
+        if os.path.basename(filename) in ('index'+config.midfix+'.html',
+                                          'peg'+config.midfix+'.html'):
             self.name = name
 
         self.files.append([filename, name])
Index: navidoc/navidoc/modules/texture.py
diff -u navidoc/navidoc/modules/texture.py:1.2 
navidoc/navidoc/modules/texture.py:1.3
--- navidoc/navidoc/modules/texture.py:1.2      Wed Apr 30 03:27:08 2003
+++ navidoc/navidoc/modules/texture.py  Thu May 22 06:52:21 2003
@@ -19,12 +19,16 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: texture.py,v 1.2 2003/04/30 07:27:08 humppake Exp $
+#$Id: texture.py,v 1.3 2003/05/22 10:52:21 humppake Exp $
 
 #
 # Written by Asko Soukka
 #
 
+"""
+This module is dependent on papers generated by a script in Libvob CVS.
+"""
+
 __docformat__ = 'reStructuredText'
 
 import config
@@ -62,8 +66,8 @@
 
 def get_texture_filename(filepath):
 
-    if filepath.endswith(".gen.html"):
-        rstpath = filepath[0:len(filepath)-9]+'.rst'
+    if filepath.endswith(config.midfix+'.html'):
+        rstpath = filepath[0:len(filepath)-(len(config.midfix)+5)]+'.rst'
         if os.path.isfile(rstpath): filepath = rstpath
     elif filepath.endswith(".html"):
         rstpath = filepath[0:len(filepath)-5]+'.rst'
@@ -77,6 +81,7 @@
 
     dbg('Filename %s Id %s' % (full_path, str(id)))
 
+    # XXX config.midfix can't be used here, because paper is generated outside 
navidoc
     return 
slashify(base_path)+slashify(config.papers_directory)+str(id)+'-paper.gen.jpg'
 
 
Index: navidoc/navidoc/mp/__init__.py
diff -u navidoc/navidoc/mp/__init__.py:1.28 navidoc/navidoc/mp/__init__.py:1.29
--- navidoc/navidoc/mp/__init__.py:1.28 Thu May 22 05:25:50 2003
+++ navidoc/navidoc/mp/__init__.py      Thu May 22 06:52:21 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-# $Id: __init__.py,v 1.28 2003/05/22 09:25:50 humppake Exp $
+# $Id: __init__.py,v 1.29 2003/05/22 10:52:21 humppake Exp $
 
 #
 # Written by Tuomas Lukka, Asko Soukka
@@ -114,7 +114,7 @@
     context_menu = ''
     
     # Refers must exist.
-    filepath = slashify(config.mp_directory)+diagram+'.gen.refers'
+    filepath = slashify(config.mp_directory)+diagram+config.midfix+'.refers'
     if (filepath):
         refers_file = open(filepath, "r")
         refers = refers_file.readlines()
@@ -172,12 +172,14 @@
 def create_uml(diagram, context='', scale=1.0):
     """
     """
-    if not os.path.isfile(slashify(config.mp_directory)+diagram+'.gen.uml'):
-        raise 
MetapostException(slashify(config.mp_directory)+diagram+'.gen.uml'+' not found')
-    if not os.path.isfile(slashify(config.mp_directory)+diagram+'.gen.mp'):
-        raise 
MetapostException(slashify(config.mp_directory)+diagram+'.gen.mp'+' not found')
+    if not 
os.path.isfile(slashify(config.mp_directory)+diagram+config.midfix+'.uml'):
+        raise MetapostException(slashify(config.mp_directory) \
+                                +diagram+config.midfix+'.uml'+' not found')
+    if not 
os.path.isfile(slashify(config.mp_directory)+diagram+config.midfix+'.mp'):
+        raise MetapostException(slashify(config.mp_directory) \
+                                +diagram+config.midfix+'.mp'+' not found')
     
-    s = open(slashify(config.mp_directory)+diagram+'.gen.uml').read()
+    s = open(slashify(config.mp_directory)+diagram+config.midfix+'.uml').read()
     l = navidoc.util.parser.parse_indented(s)
     m = navidoc.parser.ElementList(l)
 
@@ -189,10 +191,10 @@
 
     dir = slashify(config.mp_directory)
 
-    gen1 = open(dir+diagram+context+'.gen.mp.1', 'w')
+    gen1 = open(dir+diagram+context+config.midfix+'.mp.1', 'w')
     gen1.write(m.setup_code()+'\n')
     gen1.close()
-    gen2 = open(dir+diagram+context+'.gen.mp.2', 'w')
+    gen2 = open(dir+diagram+context+config.midfix+'.mp.2', 'w')
     gen2.write(m.draw_code()+"\n")
     gen2.write(draw_extra+"\n")
 
@@ -204,15 +206,16 @@
     gen2.close()
     rough_edges = []
 
-    gen3 = open(dir+diagram+context+".gen.mp.3", "w")
+    midfix = config.midfix
+    gen3 = open(dir+diagram+context+config.midfix+".mp.3", "w")
     gen3.write("""
        prologues := 1;
        input uml.mp
 
        beginfig(1)
-           input %(diagram)s%(context)s.gen.mp.1
-           input %(diagram)s.gen.mp
-           input %(diagram)s%(context)s.gen.mp.2
+           input %(diagram)s%(context)s%(midfix)s.mp.1
+           input %(diagram)s%(midfix)s.mp
+           input %(diagram)s%(context)s%(midfix)s.mp.2
        endfig
        end
        """ % locals())
@@ -227,17 +230,20 @@
 
     syscmd = 'mpost --file-line-error-style ' \
              + '--interaction nonstopmode ' \
-             + diagram +'.gen.mp.3 >/dev/null'
+             + diagram + config.midfix + '.mp.3 >/dev/null'
 
     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')
+        if config.midfix.startswith('.'):
+            midfix = '_'+config.midfix[1:]
+        else: midfix = config.midfix
+        os.rename(slashify(config.mp_directory)+diagram+config.midfix+'.mp.1',
+                  slashify(config.mp_directory)+diagram+midfix+'.eps')
         return
 
-    log = open(slashify(config.mp_directory)+diagram+'.gen.mp.log').read()
+    log = 
open(slashify(config.mp_directory)+diagram+config.midfix+'.mp.log').read()
     if log.find("\n"+'!') != -1:
         dbg_fail('Error occurred while processing the diagram. The log is 
shown below.')
         dbg_fail(log)
@@ -269,9 +275,9 @@
     scaling = int(scaling / scale)
 
     dbg("List: "+str(list))
-    syscmd = ('pstopnm '+' '.join(list)+' 
<'+slashify(config.mp_directory)+diagram+'.gen' \
+    syscmd = ('pstopnm '+' '.join(list)+' 
<'+slashify(config.mp_directory)+diagram+config.midfix \
               +""".mp.1 2>/dev/null | pnmscale -reduce %s 2>/dev/null | 
"""%scaling \
-              +'pnmtopng >'+slashify(config.mp_directory)+diagram+'.gen.png 
2>/dev/null')#
+              +'pnmtopng 
>'+slashify(config.mp_directory)+diagram+config.midfix+'.png 2>/dev/null')#
 
     dbg(syscmd)
     os.system(syscmd)
Index: navidoc/rst2any.py
diff -u navidoc/rst2any.py:1.25 navidoc/rst2any.py:1.26
--- navidoc/rst2any.py:1.25     Tue May 20 05:49:19 2003
+++ navidoc/rst2any.py  Thu May 22 06:52:20 2003
@@ -21,7 +21,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: rst2any.py,v 1.25 2003/05/20 09:49:19 humppake Exp $
+#$Id: rst2any.py,v 1.26 2003/05/22 10:52:20 humppake Exp $
 
 #
 # Written by Asko Soukka
@@ -97,18 +97,7 @@
 
     if html:
         dbg('Compiling ReST '+input)
-        if not output.endswith('index'):
-            output = output+'.gen.html'
-        else:
-# XXX - No more exceptions like this - XXX
-# (from TODO)
-#   - ".gen." midfix to be optional:
-#    + replacing ".gen" with global attribute
-#    + replacing some foo[a:b] with foo[a:len(midfix)+c]
-
-            # For practical reasons, we need to transform
-            # index.rst into index.html ...
-            output = output+'.html'
+        output = output+config.midfix+'.html'
         config.output_filename = os.path.basename(output)
         dbg_config('Output file: '+config.output_filename)
         args = '--config '+config.docutils+' '+input+' '+output
@@ -118,7 +107,7 @@
 
     if latex:
         dbg('Compiling ReST '+input)
-        output = output+'.gen.latex'
+        output = output+config.midfix+'.latex'
         config.output_filename = os.path.basename(output)
         dbg_config('Output file: '+config.output_filename)
         args = '--config '+config.docutils+' '+input+' '+output
@@ -144,7 +133,7 @@
     if imagemap:
         if os.path.isfile(path):
             last_dot = path.replace("../", "__/").rfind('.')
-            if last_dot != -1: path = path[:last_dot]+'.gen.html'
+            if last_dot != -1: path = path[:last_dot]+config.midfix+'.html'
             
         import navidoc.modules.imagemap
         config.working_directory = os.path.normpath(os.path.dirname(path))
@@ -153,7 +142,7 @@
     if texture:
         if os.path.isfile(path):
             last_dot = path.replace("../", "__/").rfind('.')
-            if last_dot != -1: path = path[:last_dot]+'.gen.html'
+            if last_dot != -1: path = path[:last_dot]+midfix+'.html'
             
         import navidoc.modules.texture
         config.working_directory = os.path.normpath(os.path.dirname(path))




reply via email to

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