Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
26e811ab
Commit
26e811ab
authored
Nov 12, 2004
by
Just van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reordered a couple of things
parent
44160946
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Lib/plat-mac/plistlib.py
Lib/plat-mac/plistlib.py
+6
-5
No files found.
Lib/plat-mac/plistlib.py
View file @
26e811ab
...
@@ -61,6 +61,7 @@ __all__ = [
...
@@ -61,6 +61,7 @@ __all__ = [
import
binascii
import
binascii
import
datetime
import
datetime
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
import
re
def
readPlist
(
pathOrFile
):
def
readPlist
(
pathOrFile
):
...
@@ -176,11 +177,6 @@ class DumbXMLWriter:
...
@@ -176,11 +177,6 @@ class DumbXMLWriter:
self
.
file
.
write
(
"
\
n
"
)
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
# 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
# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'. Smaller units may be omitted with
# a loss of precision)
# a loss of precision)
...
@@ -203,6 +199,11 @@ def _dateToString(d):
...
@@ -203,6 +199,11 @@ def _dateToString(d):
d
.
hour
,
d
.
minute
,
d
.
second
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
):
def
_escapeAndEncode
(
text
):
text
=
text
.
replace
(
"
\
r
\
n
"
,
"
\
n
"
)
# convert DOS line endings
text
=
text
.
replace
(
"
\
r
\
n
"
,
"
\
n
"
)
# convert DOS line endings
text
=
text
.
replace
(
"
\
r
"
,
"
\
n
"
)
# convert Mac line endings
text
=
text
.
replace
(
"
\
r
"
,
"
\
n
"
)
# convert Mac line endings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment