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
33f8c582
Commit
33f8c582
authored
Aug 31, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got test_plistlib working. Don't ask how.
parent
49593f63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/plat-mac/plistlib.py
Lib/plat-mac/plistlib.py
+4
-4
No files found.
Lib/plat-mac/plistlib.py
View file @
33f8c582
...
...
@@ -260,9 +260,9 @@ class PlistWriter(DumbXMLWriter):
def
writeData
(
self
,
data
):
self
.
beginElement
(
"data"
)
self
.
indentLevel
-=
1
maxlinelength
=
76
-
len
(
self
.
indent
.
replace
(
"
\
t
"
,
" "
*
8
)
*
maxlinelength
=
76
-
len
(
self
.
indent
.
replace
(
b"
\
t
"
,
b
" "
*
8
)
*
self
.
indentLevel
)
for
line
in
data
.
asBase64
(
maxlinelength
).
split
(
"
\
n
"
):
for
line
in
data
.
asBase64
(
maxlinelength
).
split
(
b
"
\
n
"
):
if
line
:
self
.
writeln
(
line
)
self
.
indentLevel
+=
1
...
...
@@ -368,11 +368,11 @@ class Data:
raise
TypeError
(
"data must be as bytes"
)
self
.
data
=
data
@
classmethod
def
fromBase64
(
cls
,
data
):
# base64.decodestring just calls binascii.a2b_base64;
# it seems overkill to use both base64 and binascii.
return
cls
(
binascii
.
a2b_base64
(
data
))
fromBase64
=
classmethod
(
fromBase64
)
def
asBase64
(
self
,
maxlinelength
=
76
):
return
_encodeBase64
(
self
.
data
,
maxlinelength
)
...
...
@@ -464,6 +464,6 @@ class PlistParser:
def
end_string
(
self
):
self
.
addObject
(
self
.
getData
())
def
end_data
(
self
):
self
.
addObject
(
Data
.
fromBase64
(
self
.
getData
()))
self
.
addObject
(
Data
.
fromBase64
(
self
.
getData
()
.
encode
(
"utf-8"
)
))
def
end_date
(
self
):
self
.
addObject
(
_dateFromString
(
self
.
getData
()))
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