/[gzz]/gzz/metacode/pegboard.py
ViewVC logotype

Diff of /gzz/metacode/pegboard.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by humppake, Fri Nov 1 10:09:56 2002 UTC revision 1.6 by humppake, Mon Nov 4 14:32:56 2002 UTC
# Line 42  for pegdir in pegdirs: Line 42  for pegdir in pegdirs:
42    
43      print 'Process PEG %s' % (pegdir)      print 'Process PEG %s' % (pegdir)
44      for rstfile in rstfiles:      for rstfile in rstfiles:
45          file = pegroot+'/'+pegdir+'/'+rstfile.rstrip('.rst')          file = pegroot+'/'+pegdir+'/'+rstfile[0:len(rstfile)-4]#.rstrip('.rst')
46    
47          # Sets docutils' "command line arguments"          # Sets docutils' "command line arguments"
48          args = '-stg --stylesheet ../'+css+' %s.rst %s.html' % (file,file)          args = '-stg --stylesheet ../'+css+' %s.rst %s.html' % (file,file)
49            
50          # Generate the HTML          # Generate the HTML
51          try:          try:
52              docutils.core.publish(writer_name='html', argv=args.split())              docutils.core.publish_cmdline(writer_name='html', argv=args.split())
53          except:          except:
54              fails += 'PEG %s: Docutil raised an exception while converting %s. ' % (pegdir, f)              fails += 'PEG %s: Docutil raised an exception while converting %s. ' % (pegdir, f)
55              fails += 'Conversion failed and HTML not created.\n'              fails += 'Conversion failed and HTML not created.\n'
# Line 57  for pegdir in pegdirs: Line 57  for pegdir in pegdirs:
57  #loop two: creating index  #loop two: creating index
58  print 'Generating pegboard2.html...\n'  print 'Generating pegboard2.html...\n'
59  args = '-stg --stylesheet '+css+' '+pegroot+'/pegboard.rst '+pegroot+'/pegboard2.html'  args = '-stg --stylesheet '+css+' '+pegroot+'/pegboard.rst '+pegroot+'/pegboard2.html'
60  docutils.core.publish(writer_name='html', argv=args.split())  docutils.core.publish_cmdline(writer_name='html', argv=args.split())
61    
62  pegboard = open (pegroot+'/pegboard2.html', 'r')  pegboard = open (pegroot+'/pegboard2.html', 'r')
63  pegboard_lines = pegboard.readlines()  pegboard_lines = pegboard.readlines()
# Line 98  for pegboard_line in pegboard_lines: Line 98  for pegboard_line in pegboard_lines:
98              if peg['topic'] == '':              if peg['topic'] == '':
99                  peg['topic'] = peg['dir']                  peg['topic'] = peg['dir']
100              if peg['pegfile'] == '':              if peg['pegfile'] == '':
101                  peg['pegfile'] = peg['files'][0]                  if peg['files']:
102                        peg['pegfile'] = peg['files'][0]
103              pegtable.append(peg)              pegtable.append(peg)
104    
105          pegtable.sort(pegcmp)          pegtable.sort(pegcmp)

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26