[Python-checkins] python/dist/src/Doc/tools mkhowto,1.39,1.39.10.1

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Sat Sep 27 03:05:46 EDT 2003


Update of /cvsroot/python/python/dist/src/Doc/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv7924
Modified Files:
 Tag: release23-maint
	mkhowto 
Log Message:
- use string methods
- make TEXINPUTS work the way it's supposed to in TeX-ish tools
Index: mkhowto
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v
retrieving revision 1.39
retrieving revision 1.39.10.1
diff -C2 -d -r1.39 -r1.39.10.1
*** mkhowto	14 May 2003 04:16:14 -0000	1.39
--- mkhowto	27 Sep 2003 07:05:44 -0000	1.39.10.1
***************
*** 44,48 ****
 import re
 import shutil
- import string
 import sys
 
--- 44,47 ----
***************
*** 244,254 ****
 self.formats = self.DEFAULT_FORMATS
 # determine the base set of texinputs directories:
! texinputs = string.split(os.environ.get("TEXINPUTS", ""), os.pathsep)
 if not texinputs:
 texinputs = ['']
! self.base_texinputs = [
! os.path.join(TOPDIR, "paper-" + self.paper),
! os.path.join(TOPDIR, "texinputs"),
! ] + texinputs
 if self.builddir:
 self.builddir = os.path.abspath(self.builddir)
--- 243,258 ----
 self.formats = self.DEFAULT_FORMATS
 # determine the base set of texinputs directories:
! texinputs = os.environ.get("TEXINPUTS", "").split(os.pathsep)
 if not texinputs:
 texinputs = ['']
! mydirs = [os.path.join(TOPDIR, "paper-" + self.paper),
! os.path.join(TOPDIR, "texinputs"),
! ]
! if '' in texinputs:
! i = texinputs.index('')
! texinputs[i:i] = mydirs
! else:
! texinputs += mydirs
! self.base_texinputs = texinputs
 if self.builddir:
 self.builddir = os.path.abspath(self.builddir)
***************
*** 321,326 ****
 
 def setup_texinputs(self):
! texinputs = [self.filedir] + list(self.options.base_texinputs)
! os.environ["TEXINPUTS"] = string.join(texinputs, os.pathsep)
 self.message("TEXINPUTS=" + os.environ["TEXINPUTS"])
 
--- 325,331 ----
 
 def setup_texinputs(self):
! texinputs = [self.filedir] + self.options.base_texinputs
! texinputs = os.pathsep.join(texinputs)
! os.environ["TEXINPUTS"] = texinputs
 self.message("TEXINPUTS=" + os.environ["TEXINPUTS"])
 
***************
*** 392,396 ****
 max_split_depth = self.options.max_split_depth
 texfile = None
! for p in string.split(os.environ["TEXINPUTS"], os.pathsep):
 fn = os.path.join(p, self.doc + ".tex")
 if os.path.isfile(fn):
--- 397,401 ----
 max_split_depth = self.options.max_split_depth
 texfile = None
! for p in os.environ["TEXINPUTS"].split(os.pathsep):
 fn = os.path.join(p, self.doc + ".tex")
 if os.path.isfile(fn):
***************
*** 414,418 ****
 texfile
 ]
! self.run(string.join(args)) # XXX need quoting!
 # ... postprocess
 shutil.copyfile(self.options.style_file,
--- 419,423 ----
 texfile
 ]
! self.run(" ".join(args)) # XXX need quoting!
 # ... postprocess
 shutil.copyfile(self.options.style_file,
***************
*** 637,646 ****
 
 def string_to_perl(s):
! return string.join(map(_to_perl.get, s), '')
 
 
 def check_for_bibtex(filename):
 fp = open(filename)
! pos = string.find(fp.read(), r"\bibdata{")
 fp.close()
 return pos >= 0
--- 642,651 ----
 
 def string_to_perl(s):
! return "".join(map(_to_perl.get, s))
 
 
 def check_for_bibtex(filename):
 fp = open(filename)
! pos = fp.read().find(r"\bibdata{")
 fp.close()
 return pos >= 0


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /