summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2004-11-12 08:02:35 (GMT)
committerJust van Rossum <just@letterror.com>2004-11-12 08:02:35 (GMT)
commit26e811abd581fbdf33327dc9704fb03a97d05c1e (patch)
tree7850cd7654835e584e39028ee662ed93337f1c62 /Lib/plat-mac
parent441609466b308b8a127f6b9bb35dc9804224541d (diff)
downloadcpython-26e811abd581fbdf33327dc9704fb03a97d05c1e.zip
cpython-26e811abd581fbdf33327dc9704fb03a97d05c1e.tar.gz
cpython-26e811abd581fbdf33327dc9704fb03a97d05c1e.tar.bz2
reordered a couple of things
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r--Lib/plat-mac/plistlib.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/plat-mac/plistlib.py b/Lib/plat-mac/plistlib.py
index f8877e9..574b45f 100644
--- a/Lib/plat-mac/plistlib.py
+++ b/Lib/plat-mac/plistlib.py
@@ -61,6 +61,7 @@ __all__ = [
import binascii
import datetime
from cStringIO import StringIO
+import re
def readPlist(pathOrFile):
@@ -176,11 +177,6 @@ class DumbXMLWriter:
self.file.write("\n")
-import re
-# Regex to strip all control chars, but for \t \n \r and \f
-_controlStripper = re.compile(r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0e\x0f"
- "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
-
# Contents should conform to a subset of ISO 8601
# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'. Smaller units may be omitted with
# a loss of precision)
@@ -203,6 +199,11 @@ def _dateToString(d):
d.hour, d.minute, d.second
)
+
+# Regex to strip all control chars, but for \t \n \r and \f
+_controlStripper = re.compile(r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")
+
def _escapeAndEncode(text):
text = text.replace("\r\n", "\n") # convert DOS line endings
text = text.replace("\r", "\n") # convert Mac line endings