File: //usr/lib64/python3.8/__pycache__/plistlib.cpython-38.opt-1.pyc
U
e5d}
@ s> d Z ddddddddd d
ddd
g
ZddlZddlZddlZddlZddlZddlmZ ddl Z ddl
Z
ddlZddlZddl
mZ ddlmZ ejddedZe ej ejdd Zdd Zdd Zdd Zdd ZG dd dZG dd
d
ZdZe dZ!dLd!d"Z"d#d$ Z#e d%ej$Z%d&d' Z&d(d) Z'd*d+ Z(G d,d- d-Z)G d.d/ d/Z*G d0d1 d1e*Z+d2d3 Z,G d4d de-Z.d5d6d7d8d9Z/e0 Z1G d:d; d;Z2d<d= Z3e4e5e6eje7fZ8G d>d? d?e0Z9d@dA Z:e;e<e,e)e+dBe=e<e:e2e9dBiZ>ddCe<dDdEd Z?ddCe<dDdFdZ@e;dCdGdHdId
ZAe;dGdCdJdKdZBdS )Ma plistlib.py -- a tool to generate and parse MacOSX .plist files.
The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.
To write out a plist file, use the dump(value, file)
function. 'value' is the top level object, 'file' is
a (writable) file object.
To parse a plist from a file, use the load(file) function,
with a (readable) file object as the only argument. It
returns the top level object (again, usually a dictionary).
To work with plist data in bytes objects, you can use loads()
and dumps().
Values can be strings, integers, floats, booleans, tuples, lists,
dictionaries (but only with string keys), Data, bytes, bytearray, or
datetime.datetime objects.
Generate Plist example:
pl = dict(
aString = "Doodah",
aList = ["A", "B", 12, 32.1, [1, 2, 3]],
aFloat = 0.1,
anInt = 728,
aDict = dict(
anotherString = "<hello & hi there!>",
aUnicodeValue = "M\xe4ssig, Ma\xdf",
aTrueValue = True,
aFalseValue = False,
),
someData = b"<binary gunk>",
someMoreData = b"<lots of binary gunk>" * 10,
aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
)
with open(fileName, 'wb') as fp:
dump(pl, fp)
Parse Plist example:
with open(fileName, 'rb') as fp:
pl = load(fp)
print(pl["aKey"])
readPlist
writePlistreadPlistFromByteswritePlistToBytesDataInvalidFileExceptionFMT_XML
FMT_BINARYloaddumploadsdumpsUID N)BytesIO)warn)ParserCreatePlistFormatzFMT_XML FMT_BINARY)modulec c s2 t | tr(t| |}|V W 5 Q R X n| V d S N)
isinstancestropen)
pathOrFilemodefp r /usr/lib64/python3.8/plistlib.py_maybe_openO s
r c
C s<