Use string methods. Re-organize imports to Python Normal Form.

This commit is contained in:
Fred Drake 2002-10-16 16:06:07 +00:00
parent 27c4e09a62
commit 2314a0470f
1 changed files with 4 additions and 3 deletions

View File

@ -10,13 +10,14 @@ latex2esis.py script when run over the Python documentation.
# generated from an SGML or an XML application. # generated from an SGML or an XML application.
import errno import errno
import esistools
import os import os
import re import re
import string import string
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
import esistools
AUTOCLOSE = () AUTOCLOSE = ()
@ -63,7 +64,7 @@ def format_attrs(attrs, xml=0):
append('%s="%s"' % (name, escape(value))) append('%s="%s"' % (name, escape(value)))
if parts: if parts:
parts.insert(0, '') parts.insert(0, '')
return string.join(parts) return " ".join(parts)
_nmtoken_rx = re.compile("[a-z][-._a-z0-9]*$", re.IGNORECASE) _nmtoken_rx = re.compile("[a-z][-._a-z0-9]*$", re.IGNORECASE)
@ -171,7 +172,7 @@ def dump_empty_element_names(knownempties):
fp = open(EMPTIES_FILENAME, "w") fp = open(EMPTIES_FILENAME, "w")
gilist = d.keys() gilist = d.keys()
gilist.sort() gilist.sort()
fp.write(string.join(gilist, "\n")) fp.write("\n".join(gilist))
fp.write("\n") fp.write("\n")
fp.close() fp.close()