[Python-checkins] python/nondist/peps pep2html.py,1.45,1.46
goodger@users.sourceforge.net
goodger@users.sourceforge.net
Fri, 18 Oct 2002 18:33:15 -0700
Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv26783
Modified Files:
pep2html.py
Log Message:
Updated for new ``publish_string()`` convenience function.
Index: pep2html.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** pep2html.py 18 Oct 2002 05:19:08 -0000 1.45
--- pep2html.py 19 Oct 2002 01:33:12 -0000 1.46
***************
*** 42,46 ****
REQUIRES = {'python': '2.2',
! 'docutils': '0.2.6'}
PROGRAM = sys.argv[0]
RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html'
--- 42,46 ----
REQUIRES = {'python': '2.2',
! 'docutils': '0.2.7'}
PROGRAM = sys.argv[0]
RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html'
***************
*** 287,307 ****
def fix_rst_pep(inpath, input_lines, outfile):
from docutils import core, io
! pub = core.Publisher()
! pub.set_reader(reader_name='pep', parser_name='restructuredtext',
! parser=None)
! pub.set_writer(writer_name='pep_html')
! if docutils_settings:
! settings = docutils_settings
! pub.settings = settings
! else:
! settings = pub.get_settings()
! settings._source = inpath
! settings._destination = outfile.name
! pub.source = io.StringInput(
! settings, source=''.join(input_lines), source_path=inpath)
! pub.destination = io.FileOutput(
! settings, destination=outfile, destination_path=outfile.name,
! autoclose=0)
! pub.publish()
--- 287,299 ----
def fix_rst_pep(inpath, input_lines, outfile):
from docutils import core, io
! output = core.publish_string(
! source=''.join(input_lines),
! source_path=inpath,
! destination_path=outfile.name,
! reader_name='pep',
! parser_name='restructuredtext',
! writer_name='pep_html',
! settings=docutils_settings)
! outfile.write(output)