diff options
author | Fred Drake <fdrake@acm.org> | 2001-09-28 16:26:13 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-09-28 16:26:13 (GMT) |
commit | 0f9bfd3ddaa08da62390c9e63ade8e4cc5c8bf73 (patch) | |
tree | de11877f28cac8f1e8859db5f9acb1f9de95df3f /Doc/tools/sgmlconv/latex2esis.py | |
parent | bbf7a407e8756195cb3ec522ed631ee685d70bd5 (diff) | |
download | cpython-0f9bfd3ddaa08da62390c9e63ade8e4cc5c8bf73.zip cpython-0f9bfd3ddaa08da62390c9e63ade8e4cc5c8bf73.tar.gz cpython-0f9bfd3ddaa08da62390c9e63ade8e4cc5c8bf73.tar.bz2 |
Convert most uses of the string module to string methods.
(string.join() lives!)
Diffstat (limited to 'Doc/tools/sgmlconv/latex2esis.py')
-rwxr-xr-x | Doc/tools/sgmlconv/latex2esis.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/tools/sgmlconv/latex2esis.py b/Doc/tools/sgmlconv/latex2esis.py index c33c4d5..32115a8 100755 --- a/Doc/tools/sgmlconv/latex2esis.py +++ b/Doc/tools/sgmlconv/latex2esis.py @@ -109,7 +109,7 @@ class Conversion: self.write = ofp.write self.ofp = ofp self.table = table - self.line = string.join(map(string.rstrip, ifp.readlines()), "\n") + self.line = string.join([s.rstrip() for s in ifp.readlines()], "\n") self.preamble = 1 def convert(self): @@ -170,7 +170,7 @@ class Conversion: entry = self.get_entry(macroname) if entry.verbatim: # magic case! - pos = string.find(line, "\\end{%s}" % macroname) + pos = line.find("\\end{%s}" % macroname) text = line[m.end(1):pos] stack.append(entry.name) self.write("(%s\n" % entry.outputname) @@ -410,7 +410,7 @@ def convert(ifp, ofp, table): def skip_white(line): while line and line[0] in " %\n\t\r": - line = string.lstrip(line[1:]) + line = line[1:].lstrip() return line @@ -461,14 +461,14 @@ class TableParser(XMLParser): self.__current.verbatim = attrs.get("verbatim") == "yes" if attrs.has_key("outputname"): self.__current.outputname = attrs.get("outputname") - self.__current.endcloses = string.split(attrs.get("endcloses", "")) + self.__current.endcloses = attrs.get("endcloses", "").split() def end_environment(self): self.end_macro() def start_macro(self, attrs): name = attrs["name"] self.__current = TableEntry(name) - self.__current.closes = string.split(attrs.get("closes", "")) + self.__current.closes = attrs.get("closes", "").split() if attrs.has_key("outputname"): self.__current.outputname = attrs.get("outputname") def end_macro(self): |