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/esis2sgml.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/esis2sgml.py')
-rwxr-xr-x | Doc/tools/sgmlconv/esis2sgml.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/tools/sgmlconv/esis2sgml.py b/Doc/tools/sgmlconv/esis2sgml.py index 7bda929..458a074 100755 --- a/Doc/tools/sgmlconv/esis2sgml.py +++ b/Doc/tools/sgmlconv/esis2sgml.py @@ -97,7 +97,7 @@ def convert(ifp, ofp, xml=0, autoclose=(), verbatims=()): data = esistools.decode(data) data = escape(data) if not inverbatim: - data = string.replace(data, "---", "—") + data = data.replace("---", "—") ofp.write(data) if "\n" in data: lastopened = None @@ -139,7 +139,7 @@ def convert(ifp, ofp, xml=0, autoclose=(), verbatims=()): lastempty = 0 inverbatim = 0 elif type == "A": - name, type, value = string.split(data, " ", 2) + name, type, value = data.split(" ", 2) name = map_gi(name, _attr_map) attrs[name] = esistools.decode(value) elif type == "e": @@ -165,7 +165,7 @@ def dump_empty_element_names(knownempties): line = fp.readline() if not line: break - gi = string.strip(line) + gi = line.strip() if gi: d[gi] = gi fp = open(EMPTIES_FILENAME, "w") @@ -177,9 +177,9 @@ def dump_empty_element_names(knownempties): def update_gi_map(map, names, fromsgml=1): - for name in string.split(names, ","): + for name in names.split(","): if fromsgml: - uncased = string.lower(name) + uncased = name.lower() else: uncased = name map[uncased] = name @@ -211,7 +211,7 @@ def main(): elif opt in ("-x", "--xml"): xml = 1 elif opt in ("-a", "--autoclose"): - autoclose = string.split(arg, ",") + autoclose = arg.split(",") elif opt == "--elements-map": elem_names = ("%s,%s" % (elem_names, arg))[1:] elif opt == "--attributes-map": @@ -241,9 +241,9 @@ def main(): # stream but set up conversion tables to get the case right on output global _normalize_case _normalize_case = string.lower - update_gi_map(_elem_map, string.split(elem_names, ",")) - update_gi_map(_attr_map, string.split(attr_names, ",")) - update_gi_map(_values_map, string.split(value_names, ",")) + update_gi_map(_elem_map, elem_names.split(",")) + update_gi_map(_attr_map, attr_names.split(",")) + update_gi_map(_values_map, value_names.split(",")) else: global map_gi map_gi = null_map_gi |