[Python-checkins] python/nondist/peps pep2html.py,1.50,1.51

goodger at users.sourceforge.net goodger at users.sourceforge.net
Fri Apr 2 14:20:21 EST 2004


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22283

Modified Files:
	pep2html.py 
Log Message:
changes from Docutils project: reformatted docstring/help; send -h/--help output to stdout not stderr; enable exception tracebacks from Docutils; improved version checking

Index: pep2html.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** pep2html.py	13 Nov 2002 01:36:44 -0000	1.50
--- pep2html.py	2 Apr 2004 19:20:13 -0000	1.51
***************
*** 2,36 ****
  """Convert PEPs to (X)HTML - courtesy of /F
  
! Usage: %(PROGRAM)s [options] [peps]
  
  Options:
  
!     -u/--user
!         python.org username
  
!     -b/--browse
!         After generating the HTML, direct your web browser to view it
!         (using the Python webbrowser module).  If both -i and -b are
!         given, this will browse the on-line HTML; otherwise it will
!         browse the local HTML.  If no pep arguments are given, this
!         will browse PEP 0.
  
!     -i/--install
!         After generating the HTML, install it and the plaintext source file
!         (.txt) on python.org.  In that case the user's name is used in the scp
!         and ssh commands, unless "-u username" is given (in which case, it is
!         used instead).  Without -i, -u is ignored.
  
!     -l/--local
!         Same as -i/--install, except install on the local machine.  Use this
!         when logged in to the python.org machine (creosote).
  
!     -q/--quiet
!         Turn off verbose messages.
  
!     -h/--help
!         Print this help message and exit.
  
! The optional argument `peps' is a list of either pep numbers or .txt files.
  """
  
--- 2,36 ----
  """Convert PEPs to (X)HTML - courtesy of /F
  
! Usage: %(PROGRAM)s [options] [<peps> ...]
  
  Options:
  
! -u, --user
!     python.org username
  
! -b, --browse
!     After generating the HTML, direct your web browser to view it
!     (using the Python webbrowser module).  If both -i and -b are
!     given, this will browse the on-line HTML; otherwise it will
!     browse the local HTML.  If no pep arguments are given, this
!     will browse PEP 0.
  
! -i, --install
!     After generating the HTML, install it and the plaintext source file
!     (.txt) on python.org.  In that case the user's name is used in the scp
!     and ssh commands, unless "-u username" is given (in which case, it is
!     used instead).  Without -i, -u is ignored.
  
! -l, --local
!     Same as -i/--install, except install on the local machine.  Use this
!     when logged in to the python.org machine (creosote).
  
! -q, --quiet
!     Turn off verbose messages.
  
! -h, --help
!     Print this help message and exit.
  
! The optional arguments ``peps`` are either pep numbers or .txt files.
  """
  
***************
*** 82,88 ****
  
  def usage(code, msg=''):
!     print >> sys.stderr, __doc__ % globals()
      if msg:
!         print >> sys.stderr, msg
      sys.exit(code)
  
--- 82,93 ----
  
  def usage(code, msg=''):
!     """Print usage message and exit.  Uses stderr if code != 0."""
!     if code == 0:
!         out = sys.stdout
!     else:
!         out = sys.stderr
!     print >> out, __doc__ % globals()
      if msg:
!         print >> out, msg
      sys.exit(code)
  
***************
*** 303,307 ****
          parser_name='restructuredtext',
          writer_name='pep_html',
!         settings=docutils_settings)
      outfile.write(output)
  
--- 308,314 ----
          parser_name='restructuredtext',
          writer_name='pep_html',
!         settings=docutils_settings,
!         # Allow Docutils traceback if there's an exception:
!         settings_overrides={'traceback': 1})
      outfile.write(output)
  
***************
*** 424,428 ****
              'See README.txt for installation.')
      else:
!         if docutils.__version__ < REQUIRES['docutils']:
              PEP_TYPE_DISPATCH['text/x-rst'] = None
              PEP_TYPE_MESSAGES['text/x-rst'] = (
--- 431,437 ----
              'See README.txt for installation.')
      else:
!         installed = [int(part) for part in docutils.__version__.split('.')]
!         required = [int(part) for part in REQUIRES['docutils'].split('.')]
!         if installed < required:
              PEP_TYPE_DISPATCH['text/x-rst'] = None
              PEP_TYPE_MESSAGES['text/x-rst'] = (




More information about the Python-checkins mailing list