[Python-checkins] python/dist/src/Doc/tools prechm.py,1.2,1.3

tim_one@sourceforge.net tim_one@sourceforge.net
Fri, 19 Apr 2002 11:07:54 -0700


Update of /cvsroot/python/python/dist/src/Doc/tools
In directory usw-pr-cvs1:/tmp/cvs-serv2564

Modified Files:
	prechm.py 
Log Message:
project_template:  use dict interpolation instead of giant tuples.


Index: prechm.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/prechm.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** prechm.py	19 Apr 2002 16:46:43 -0000	1.2
--- prechm.py	19 Apr 2002 18:07:52 -0000	1.3
***************
*** 23,30 ****
  import getopt
  
- 
- 
- # moved all the triple_quote up here because my syntax-coloring editor
- # sucks a little bit.
  usage_mode = '''
  Usage: make_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename
--- 23,26 ----
***************
*** 36,56 ****
  '''
  
! # project file (*.hhp) template. there are seven %s
  project_template = '''
  [OPTIONS]
  Compatibility=1.1
! Compiled file=%s.chm
! Contents file=%s.hhc
! Default Window=%s
  Default topic=index.html
  Display compile progress=No
  Full-text search=Yes
! Index file=%s.hhk
  Language=0x409
! Title=Python %s Documentation
  
  [WINDOWS]
! %s="Python %s Documentation","%s.hhc","%s.hhk","index.html","index.html",\
! ,,,,0x63520,220,0x384e,[271,372,740,718],,,,,,,0
  
  [FILES]
--- 32,56 ----
  '''
  
! # Project file (*.hhp) template.  'arch' is the file basename (like
! # the pythlp in pythlp.hhp); 'version' is the doc version number (like
! # the 2.2 in Python 2.2).
! # The magical numbers in the long line under [WINDOWS] set most of the
! # user-visible features (visible buttons, tabs, etc).
  project_template = '''
  [OPTIONS]
  Compatibility=1.1
! Compiled file=%(arch)s.chm
! Contents file=%(arch)s.hhc
! Default Window=%(arch)s
  Default topic=index.html
  Display compile progress=No
  Full-text search=Yes
! Index file=%(arch)s.hhk
  Language=0x409
! Title=Python %(version)s Documentation
  
  [WINDOWS]
! %(arch)s="Python %(version)s Documentation","%(arch)s.hhc","%(arch)s.hhk",\
! "index.html","index.html",,,,,0x63520,220,0x384e,[271,372,740,718],,,,,,,0
  
  [FILES]
***************
*** 286,291 ****
  
  def do_project( library, output, arch, version) :
!     output.write( project_template % \
!             (arch, arch, arch, arch, version, arch, version, arch, arch) )
      for book in library :
          for page in os.listdir(book[0]) :
--- 286,290 ----
  
  def do_project( library, output, arch, version) :
!     output.write(project_template % locals())
      for book in library :
          for page in os.listdir(book[0]) :