gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/metacode pegboard.py


From: Asko Soukka
Subject: [Gzz-commits] gzz/metacode pegboard.py
Date: Mon, 04 Nov 2002 09:32:56 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/11/04 09:32:56

Modified files:
        metacode       : pegboard.py 

Log message:
        Should now work with Python2.1, but uses still 
docutils.core.publish_cmdline instead of docutils.core.publish, which benja 
originally used.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/pegboard.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gzz/metacode/pegboard.py
diff -u gzz/metacode/pegboard.py:1.5 gzz/metacode/pegboard.py:1.6
--- gzz/metacode/pegboard.py:1.5        Fri Nov  1 05:09:56 2002
+++ gzz/metacode/pegboard.py    Mon Nov  4 09:32:56 2002
@@ -42,14 +42,14 @@
 
     print 'Process PEG %s' % (pegdir)
     for rstfile in rstfiles:
-        file = pegroot+'/'+pegdir+'/'+rstfile.rstrip('.rst')
+        file = pegroot+'/'+pegdir+'/'+rstfile[0:len(rstfile)-4]#.rstrip('.rst')
 
         # Sets docutils' "command line arguments"
         args = '-stg --stylesheet ../'+css+' %s.rst %s.html' % (file,file)
     
         # Generate the HTML
         try:
-            docutils.core.publish(writer_name='html', argv=args.split())
+            docutils.core.publish_cmdline(writer_name='html', 
argv=args.split())
         except:
             fails += 'PEG %s: Docutil raised an exception while converting %s. 
' % (pegdir, f)
             fails += 'Conversion failed and HTML not created.\n'
@@ -57,7 +57,7 @@
 #loop two: creating index
 print 'Generating pegboard2.html...\n'
 args = '-stg --stylesheet '+css+' '+pegroot+'/pegboard.rst 
'+pegroot+'/pegboard2.html'
-docutils.core.publish(writer_name='html', argv=args.split())
+docutils.core.publish_cmdline(writer_name='html', argv=args.split())
 
 pegboard = open (pegroot+'/pegboard2.html', 'r')
 pegboard_lines = pegboard.readlines()
@@ -98,7 +98,8 @@
             if peg['topic'] == '':
                 peg['topic'] = peg['dir']
             if peg['pegfile'] == '':
-                peg['pegfile'] = peg['files'][0]
+                if peg['files']:
+                    peg['pegfile'] = peg['files'][0]
             pegtable.append(peg)
 
         pegtable.sort(pegcmp)




reply via email to

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