[Python-checkins] python/nondist/peps pep2html.py,1.44,1.45

goodger@users.sourceforge.net goodger@users.sourceforge.net
Thu, 17 Oct 2002 22:19:11 -0700


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv19390

Modified Files:
	pep2html.py 
Log Message:
updated for Docutils API changes

Index: pep2html.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** pep2html.py	12 Sep 2002 02:31:38 -0000	1.44
--- pep2html.py	18 Oct 2002 05:19:08 -0000	1.45
***************
*** 42,46 ****
  
  REQUIRES = {'python': '2.2',
!             'docutils': '0.2.3'}
  PROGRAM = sys.argv[0]
  RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html'
--- 42,46 ----
  
  REQUIRES = {'python': '2.2',
!             'docutils': '0.2.6'}
  PROGRAM = sys.argv[0]
  RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html'
***************
*** 281,287 ****
  
  
! docutils_options = None
! """Option value object used by Docutils.  Can be set by the client application
! when this module is imported."""
  
  def fix_rst_pep(inpath, input_lines, outfile):
--- 281,287 ----
  
  
! docutils_settings = None
! """Runtime settings object used by Docutils.  Can be set by the client
! application when this module is imported."""
  
  def fix_rst_pep(inpath, input_lines, outfile):
***************
*** 291,305 ****
                     parser=None)
      pub.set_writer(writer_name='pep_html')
!     if docutils_options:
!         options = docutils_options
!         pub.options = options
      else:
!         options = pub.set_options()
!     options._source = inpath
!     options._destination = outfile.name
      pub.source = io.StringInput(
!         options, source=''.join(input_lines), source_path=inpath)
      pub.destination = io.FileOutput(
!         options, destination=outfile, destination_path=outfile.name,
          autoclose=0)
      pub.publish()
--- 291,305 ----
                     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()