diff options
author | Fred Drake <fdrake@acm.org> | 2002-10-16 15:30:17 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-10-16 15:30:17 (GMT) |
commit | 071972e426c9782611bd5b66f036d35d809f7ee4 (patch) | |
tree | ec6f4f3a441a7365759dd13566c334b3d03ad97f /Doc/tools/rewrite.py | |
parent | 06912b7702e46a1a31749b31911be4d44ccbdf27 (diff) | |
download | cpython-071972e426c9782611bd5b66f036d35d809f7ee4.zip cpython-071972e426c9782611bd5b66f036d35d809f7ee4.tar.gz cpython-071972e426c9782611bd5b66f036d35d809f7ee4.tar.bz2 |
Use string methods.
Diffstat (limited to 'Doc/tools/rewrite.py')
-rw-r--r-- | Doc/tools/rewrite.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Doc/tools/rewrite.py b/Doc/tools/rewrite.py index e822bf5..f2c1b80 100644 --- a/Doc/tools/rewrite.py +++ b/Doc/tools/rewrite.py @@ -3,7 +3,6 @@ Usage: rewrite.py boilerplate.tex [VAR=value] ... <template >output """ -import string import sys import time @@ -12,9 +11,9 @@ def get_info(fp): s = fp.read() d = {} - start = string.find(s, r"\date{") + start = s.find(r"\date{") if start >= 0: - end = string.find(s, "}", start) + end = s.find("}", start) date = s[start+6:end] if date == r"\today": date = time.strftime("%B %d, %Y", time.localtime(time.time())) @@ -28,14 +27,14 @@ def main(): # yes, we actully need to load the replacement values d = get_info(open(sys.argv[1])) for arg in sys.argv[2:]: - name, value = string.split(arg, "=", 1) + name, value = arg.split("=", 1) d[name] = value start = 0 while 1: - start = string.find(s, "@", start) + start = s.find("@", start) if start < 0: break - end = string.find(s, "@", start+1) + end = s.find("@", start+1) name = s[start+1:end] if name: value = d.get(name) |