/usr/lib/python3.10/__pycache__
NameSizeModeActions
abc.cpython-310.pyc67510644editdlrm
aifc.cpython-310.pyc246850644editdlrm
antigravity.cpython-310.pyc8220644editdlrm
argparse.cpython-310.pyc635390644editdlrm
ast.cpython-310.pyc557390644editdlrm
asynchat.cpython-310.pyc70250644editdlrm
asyncore.cpython-310.pyc160020644editdlrm
base64.cpython-310.pyc171620644editdlrm
bdb.cpython-310.pyc258320644editdlrm
binhex.cpython-310.pyc128700644editdlrm
bisect.cpython-310.pyc25880644editdlrm
bz2.cpython-310.pyc108700644editdlrm
calendar.cpython-310.pyc263030644editdlrm
cgi.cpython-310.pyc267230644editdlrm
cgitb.cpython-310.pyc99980644editdlrm
chunk.cpython-310.pyc48600644editdlrm
cmd.cpython-310.pyc127070644editdlrm
code.cpython-310.pyc99570644editdlrm
codecs.cpython-310.pyc332190644editdlrm
codeop.cpython-310.pyc55950644editdlrm
colorsys.cpython-310.pyc32650644editdlrm
compileall.cpython-310.pyc127330644editdlrm
configparser.cpython-310.pyc454580644editdlrm
contextlib.cpython-310.pyc208950644editdlrm
contextvars.cpython-310.pyc2460644editdlrm
copy.cpython-310.pyc69960644editdlrm
copyreg.cpython-310.pyc46830644editdlrm
cProfile.cpython-310.pyc51130644editdlrm
crypt.cpython-310.pyc35500644editdlrm
csv.cpython-310.pyc117980644editdlrm
dataclasses.cpython-310.pyc265780644editdlrm
datetime.cpython-310.pyc565330644editdlrm
decimal.cpython-310.pyc3620644editdlrm
difflib.cpython-310.pyc589050644editdlrm
dis.cpython-310.pyc156560644editdlrm
doctest.cpython-310.pyc761750644editdlrm
enum.cpython-310.pyc260630644editdlrm
filecmp.cpython-310.pyc87490644editdlrm
fileinput.cpython-310.pyc140720644editdlrm
fnmatch.cpython-310.pyc42440644editdlrm
fractions.cpython-310.pyc186000644editdlrm
ftplib.cpython-310.pyc290340644editdlrm
functools.cpython-310.pyc283350644editdlrm
genericpath.cpython-310.pyc39070644editdlrm
getopt.cpython-310.pyc63390644editdlrm
getpass.cpython-310.pyc42100644editdlrm
gettext.cpython-310.pyc182210644editdlrm
glob.cpython-310.pyc58520644editdlrm
graphlib.cpython-310.pyc76160644editdlrm
gzip.cpython-310.pyc185460644editdlrm
hashlib.cpython-310.pyc68450644editdlrm
heapq.cpython-310.pyc138650644editdlrm
hmac.cpython-310.pyc69730644editdlrm
imaplib.cpython-310.pyc423120644editdlrm
imghdr.cpython-310.pyc39050644editdlrm
imp.cpython-310.pyc97860644editdlrm
inspect.cpython-310.pyc851530644editdlrm
io.cpython-310.pyc36630644editdlrm
ipaddress.cpython-310.pyc626700644editdlrm
keyword.cpython-310.pyc9270644editdlrm
linecache.cpython-310.pyc41420644editdlrm
locale.cpython-310.pyc461540644editdlrm
lzma.cpython-310.pyc121000644editdlrm
mailbox.cpython-310.pyc600910644editdlrm
mailcap.cpython-310.pyc73200644editdlrm
mimetypes.cpython-310.pyc176190644editdlrm
modulefinder.cpython-310.pyc161660644editdlrm
netrc.cpython-310.pyc39330644editdlrm
nntplib.cpython-310.pyc316230644editdlrm
ntpath.cpython-310.pyc147040644editdlrm
nturl2path.cpython-310.pyc17470644editdlrm
numbers.cpython-310.pyc118660644editdlrm
opcode.cpython-310.pyc54470644editdlrm
operator.cpython-310.pyc135080644editdlrm
optparse.cpython-310.pyc477540644editdlrm
os.cpython-310.pyc315990644editdlrm
pathlib.cpython-310.pyc420520644editdlrm
pdb.cpython-310.pyc474400644editdlrm
pickle.cpython-310.pyc468820644editdlrm
pickletools.cpython-310.pyc677600644editdlrm
pipes.cpython-310.pyc77690644editdlrm
pkgutil.cpython-310.pyc183610644editdlrm
platform.cpython-310.pyc274290644editdlrm
plistlib.cpython-310.pyc237650644editdlrm
poplib.cpython-310.pyc135730644editdlrm
posixpath.cpython-310.pyc105600644editdlrm
pprint.cpython-310.pyc178750644editdlrm
profile.cpython-310.pyc143910644editdlrm
pstats.cpython-310.pyc236210644editdlrm
pty.cpython-310.pyc41430644editdlrm
pyclbr.cpython-310.pyc97750644editdlrm
pydoc.cpython-310.pyc856450644editdlrm
py_compile.cpython-310.pyc73390644editdlrm
queue.cpython-310.pyc107920644editdlrm
quopri.cpython-310.pyc57940644editdlrm
random.cpython-310.pyc227480644editdlrm
re.cpython-310.pyc142270644editdlrm
reprlib.cpython-310.pyc52500644editdlrm
rlcompleter.cpython-310.pyc59540644editdlrm
runpy.cpython-310.pyc94110644editdlrm
sched.cpython-310.pyc61150644editdlrm
secrets.cpython-310.pyc21750644editdlrm
selectors.cpython-310.pyc171050644editdlrm
shelve.cpython-310.pyc94920644editdlrm
shlex.cpython-310.pyc77820644editdlrm
shutil.cpython-310.pyc385360644editdlrm
signal.cpython-310.pyc29350644editdlrm
site.cpython-310.pyc179220644editdlrm
sitecustomize.cpython-310.pyc2250644editdlrm
smtpd.cpython-310.pyc261470644editdlrm
smtplib.cpython-310.pyc357660644editdlrm
sndhdr.cpython-310.pyc69620644editdlrm
socket.cpython-310.pyc289630644editdlrm
socketserver.cpython-310.pyc253470644editdlrm
sre_compile.cpython-310.pyc151940644editdlrm
sre_constants.cpython-310.pyc63570644editdlrm
sre_parse.cpython-310.pyc217550644editdlrm
ssl.cpython-310.pyc452710644editdlrm
stat.cpython-310.pyc42730644editdlrm
statistics.cpython-310.pyc370510644editdlrm
string.cpython-310.pyc71020644editdlrm
stringprep.cpython-310.pyc170750644editdlrm
struct.cpython-310.pyc3070644editdlrm
subprocess.cpython-310.pyc447410644editdlrm
sunau.cpython-310.pyc164820644editdlrm
symtable.cpython-310.pyc128350644editdlrm
sysconfig.cpython-310.pyc181510644editdlrm
tabnanny.cpython-310.pyc69500644editdlrm
tarfile.cpython-310.pyc715780644editdlrm
telnetlib.cpython-310.pyc185060644editdlrm
tempfile.cpython-310.pyc273390644editdlrm
textwrap.cpython-310.pyc138120644editdlrm
this.cpython-310.pyc12640644editdlrm
threading.cpython-310.pyc449690644editdlrm
timeit.cpython-310.pyc117690644editdlrm
token.cpython-310.pyc27380644editdlrm
tokenize.cpython-310.pyc171940644editdlrm
trace.cpython-310.pyc198700644editdlrm
traceback.cpython-310.pyc217120644editdlrm
tracemalloc.cpython-310.pyc175250644editdlrm
tty.cpython-310.pyc10790644editdlrm
turtle.cpython-310.pyc1288570644editdlrm
types.cpython-310.pyc95250644editdlrm
typing.cpython-310.pyc852770644editdlrm
uu.cpython-310.pyc38670644editdlrm
uuid.cpython-310.pyc224980644editdlrm
warnings.cpython-310.pyc136460644editdlrm
wave.cpython-310.pyc175940644editdlrm
weakref.cpython-310.pyc203430644editdlrm
webbrowser.cpython-310.pyc174630644editdlrm
xdrlib.cpython-310.pyc78800644editdlrm
zipapp.cpython-310.pyc60130644editdlrm
zipfile.cpython-310.pyc618450644editdlrm
zipimport.cpython-310.pyc170330644editdlrm
_aix_support.cpython-310.pyc28790644editdlrm
_bootsubprocess.cpython-310.pyc22940644editdlrm
_collections_abc.cpython-310.pyc329250644editdlrm
_compat_pickle.cpython-310.pyc58720644editdlrm
_compression.cpython-310.pyc45120644editdlrm
_distutils_system_mod.cpython-310.pyc54220644editdlrm
_markupbase.cpython-310.pyc75720644editdlrm
_osx_support.cpython-310.pyc115350644editdlrm
_pydecimal.cpython-310.pyc1577360644editdlrm
_pyio.cpython-310.pyc736540644editdlrm
_py_abc.cpython-310.pyc46830644editdlrm
_sitebuiltins.cpython-310.pyc35470644editdlrm
_strptime.cpython-310.pyc159450644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc353850644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-310.pyc353790644editdlrm
_threading_local.cpython-310.pyc65390644editdlrm
_weakrefset.cpython-310.pyc76080644editdlrm
__future__.cpython-310.pyc41310644editdlrm
__phello__.foo.cpython-310.pyc1300644editdlrm
Edit: /usr/lib/python3.10/__pycache__/plistlib.cpython-310.pyc (23765B)
o 9jo@sdZgdZddlZddlZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl m Z ejddedZeejd ZGd d d Zd Ze d Zd?ddZddZe de jZddZddZddZGdddZ GdddZ!Gddde!Z"d d!Z#Gd"d#d#e$Z%d$d%d&d'd(Z&e'Z(Gd)d*d*Z)d+d,Z*e+e,e-eje.fZ/Gd-d.d.e'Z0d/d0Z1e2e3e#e e"d1e4e3e1e)e0d1iZ5de3d2d3d4Z6de3d2d5d6Z7e2d7d8d9d:d;Z8e2d8d7d<d=d>Z9dS)@a>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: import datetime import plistlib pl = dict( aString = "Doodah", aList = ["A", "B", 12, 32.1, [1, 2, 3]], aFloat = 0.1, anInt = 728, aDict = dict( anotherString = "", aThirdString = "M\xe4ssig, Ma\xdf", aTrueValue = True, aFalseValue = False, ), someData = b"", someMoreData = b"" * 10, aDate = datetime.datetime.now() ) print(plistlib.dumps(pl).decode()) Parse Plist example: import plistlib plist = b''' foo bar ''' pl = plistlib.loads(plist) print(pl["foo"]) )InvalidFileExceptionFMT_XML FMT_BINARYloaddumploadsdumpsUIDN)BytesIO) ParserCreate PlistFormatzFMT_XML FMT_BINARY)moduleic@<eZdZddZddZddZddZd d Zd d Zd S)rcCs<t|ts td|dkrtd|dkrtd||_dS)Nzdata must be an intzUIDs cannot be >= 2**64r UIDs must be positive) isinstanceint TypeError ValueErrordataselfrr/usr/lib/python3.10/plistlib.py__init__Qs  z UID.__init__cCs|jSN)rrrrr __index__Zsz UID.__index__cCsd|jjt|jfS)Nz%s(%s)) __class____name__reprrrrrr__repr__]z UID.__repr__cCs|j|jffSr)rrrrrr __reduce__`zUID.__reduce__cCst|tstS|j|jkSr)rrNotImplementedr)rotherrrr__eq__cs  z UID.__eq__cCs t|jSr)hashrrrrr__hash__h z UID.__hash__N) r __module__ __qualname__rrr!r#r'r)rrrrrPs  rs zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]LcCsP|dd}g}tdt||D]}||||}|t|qd|S)Nr )rangelenappendbinascii b2a_base64join)s maxlinelength maxbinsizepiecesichunkrrr_encode_base64|s  r=cCs$t|tr t|dSt|S)Nutf-8)rstrr4 a2b_base64encode)r7rrr_decode_base64s  rBz{(?P\d\d\d\d)(?:-(?P\d\d)(?:-(?P\d\d)(?:T(?P\d\d)(?::(?P\d\d)(?::(?P\d\d))?)?)?)?)?ZcCsLd}t|}g}|D]}||}|durn|t|q tj|S)Nyearmonthdayhourminutesecond) _dateParsermatch groupdictr3rdatetime)r7ordergdlstkeyvalrrr_date_from_strings rScCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZrC)drrr_date_to_strings  rUcCsZt|}|dur td|dd}|dd}|dd}|dd}|d d }|S) Nz;strings can't contain control characters; use bytes insteadz   &z&z>)_controlCharPatsearchrreplace)textmrrr_escapes      r`c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)S)* _PlistParsercCsg|_d|_d|_||_dSr)stack current_keyroot _dict_typer dict_typerrrr z_PlistParser.__init__cCsBt|_|j|j_|j|j_|j|j_|j|j_ |j ||j Sr) r parserhandle_begin_elementStartElementHandlerhandle_end_elementEndElementHandler handle_dataCharacterDataHandlerhandle_entity_declEntityDeclHandler ParseFilerd)rfileobjrrrparses     z_PlistParser.parsecCstd)Nz8XML entity declarations are not supported in plist files)r)r entity_nameis_parameter_entityvaluebase system_id public_id notation_namerrrrpsz_PlistParser.handle_entity_declcCs.g|_t|d|d}|dur||dSdS)Nbegin_)rgetattr)relementattrshandlerrrrrjs  z!_PlistParser.handle_begin_elementcCs&t|d|d}|dur|dSdS)Nend_)r})rr~rrrrrls z_PlistParser.handle_end_elementcCs|j|dSr)rr3rrrrrnz_PlistParser.handle_datacCs|jdur$t|jdtistd|jj||jd|j<d|_dS|js,||_dSt|jdtgs>td|jj|jd|dS)Nzunexpected element at line %d) rcrrbtyperriCurrentLineNumberrdr3rrwrrr add_objects   z_PlistParser.add_objectcCsd|j}g|_|S)N)r6rrrrrget_datas z_PlistParser.get_datacCs"|}|||j|dSr)rerrbr3)rrrTrrr begin_dicts z_PlistParser.begin_dictcCs*|jrtd|j|jjf|jdS)Nz%missing value for key '%s' at line %d)rcrrirrbpoprrrrend_dicts  z_PlistParser.end_dictcCs8|js t|jdtistd|jj||_dS)Nrzunexpected key at line %d)rcrrbrrrirrrrrrend_keys z_PlistParser.end_keycCsg}|||j|dSr)rrbr3)rrarrr begin_arrays z_PlistParser.begin_arraycCs|jdSr)rbrrrrr end_arrayr$z_PlistParser.end_arraycC|ddS)NTrrrrrend_truer$z_PlistParser.end_truecCr)NFrrrrr end_falser$z_PlistParser.end_falsecCsB|}|ds|dr|t|ddS|t|dS)N0x0X)r startswithrr)rrawrrr end_integer sz_PlistParser.end_integercC|t|dSr)rfloatrrrrrend_realr"z_PlistParser.end_realcCs||dSr)rrrrrr end_stringsz_PlistParser.end_stringcCrr)rrBrrrrrend_datar"z_PlistParser.end_datacCrr)rrSrrrrrend_dater"z_PlistParser.end_dateN)rr+r,rrtrprjrlrnrrrrrrrrrrrrrrrrrrras*  rac@s8eZdZdddZddZddZdd d Zd d Zd S)_DumbXMLWriterr  cCs||_g|_||_||_dSr)filerb _indent_levelindent)rr indent_levelrrrrrrhz_DumbXMLWriter.__init__cCs,|j||d||jd7_dS)Nz<%s>)rbr3writelnrrr~rrr begin_element%s z_DumbXMLWriter.begin_elementcCs@|jdksJ|j|ksJ|jd8_|d|dS)Nr rz)rrbrrrrrr end_element*sz_DumbXMLWriter.end_elementNcCs:|durt|}|d|||fdS|d|dS)Nz <%s>%sz<%s/>)r`r)rr~rwrrrsimple_element0sz_DumbXMLWriter.simple_elementcCsH|rt|tr |d}|j|j|j|j||jddS)Nr> )rr?rArwriterr)rlinerrrr8s    z_DumbXMLWriter.writeln)r rr)rr+r,rrrrrrrrrrs    rc@sBeZdZ  dddZdd Zd d Zd d ZddZddZdS) _PlistWriterr  rTFcCs.|r|tt||||||_||_dSr)r PLISTHEADERrr _sort_keys _skipkeys)rrrr writeHeader sort_keysskipkeysrrrrEs   z_PlistWriter.__init__cCs"|d|||ddS)Nzz)r write_valuerrrrrOs  z_PlistWriter.writecCs(t|tr |d|dS|dur|ddS|dur#|ddSt|trEd|kr2dkrAnt||dd |dSt|t|trT|d t|dSt|tr`||dSt|t t frn| |dSt|t j r~|d t |dSt|ttfr||dStd t|) NstringTtrueFfalselrintegerz%drealdatezunsupported type: %s)rr?rr OverflowErrorrr dict write_dictbytes bytearray write_bytesrMrUtuplelist write_arrayrrrrrrrTs,     z_PlistWriter.write_valuecCsz|d|jd8_tddt|jdd|j}t||dD] }|r.||q%|jd7_| ddS)Nrrrr-rs r) rrmaxr2rr]r=splitrr)rrr8rrrrrvs  z_PlistWriter.write_bytescCs|r;|d|jrt|}n|}|D]\}}t|ts(|jr$qtd|d|| |q| ddS|ddS)Nrkeys must be stringsrQ) rrsorteditemsrr?rrrrr)rrTrrQrwrrrrs     z_PlistWriter.write_dictcCs>|r|d|D]}||q |ddS|ddS)Narray)rrrr)rrrwrrrrs   z_PlistWriter.write_arrayN)r rrTF) rr+r,rrrrrrrrrrrDs  " rcCsd}|D] }||rdSqtjdftjdftjdffD]'\}}||s'q|D]}||d|}|dt||krCdSq)qdS)N)sz utf-16-bez utf-16-leasciiF)rcodecsBOM_UTF8 BOM_UTF16_BE BOM_UTF16_LEdecoderAr2)headerprefixespfxbomencodingstartprefixrrr _is_fmt_xmls$  rc@seZdZdddZdS)r Invalid filecCst||dSr)rr)rmessagerrrrrzInvalidFileException.__init__N)r)rr+r,rrrrrrsrBHLQ)rr.c@sHeZdZdZddZddZddZdd Zd d Zd d Z ddZ dS)_BinaryPlistParsera Read or write a binary plist file, following the description of the binary format. Raise InvalidFileException in case of error, otherwise return the root object. see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c cCs ||_dSr)rerfrrrrr*z_BinaryPlistParser.__init__c Csz?||_|jdtj|jd}t|dkrttd|\}|_ }}}|j|| |||_ t g||_ ||WStttjttfyOtw)Ni z>6xBBQQQ)_fpseekosSEEK_ENDreadr2rstructunpack _ref_size _read_ints_object_offsets _undefined_objects _read_objectOSError IndexErrorerrorrr)rfptrailer offset_size num_objects top_objectoffset_table_offsetrrrrts&         z_BinaryPlistParser.parsecCsL|dkr$|jddd@}d|>}dt|}t||j|dS|S)z$ return the size of the next object.rr r/rZ)rr_BINARY_FORMATrr)rtokenLr_r7frrr _get_sizes  z_BinaryPlistParser._get_sizecCs\t|t}|j|} t||krt||kr|St|||}||j|7}||7}q r)min_MIN_READ_BUF_SIZErrr2r)rsizecursizerdeltarrr_reads   z_BinaryPlistParser._readcs^||tvrtd|tSsttfddtd|DS)NrZc3s(|]}t||dVqdS)bigN)r from_bytes).0r;rrrr s z0_BinaryPlistParser._read_ints..r )rrrrrrr1)rnrrr rrsz_BinaryPlistParser._read_intscCs|||jSr)rr)rr rrr _read_refsr$z_BinaryPlistParser._read_refscsj|}|tur |Sj|}j|jdd}|d@|d@}}|dkr/d}n|dkr7d}n|dkr?d }n|dkrGd }n|d kr\tjjd|>d |d kd}n|dkrmt djdd}n|dkr~t djdd}n|dkrt djdd}t dddt j |d}n|dkr |} |}n|dkr |} |} | d}n|dkrՈ |d} |} | d}ny|dkrttjd|d }nf|dkr |}|} g}|j|<|fdd | DnC|d!krK |}|} |} }|j|<zt| | D]\} } | || <q.WntyJtwt|j|<|S)"zx read the object by reference. May recursively read sub-objects (content of an array/dict/set) rr rNrF Tr0rrr/signed"z>fr.#z>d3)seconds@Pr`rutf-16bec3s|]}|VqdSr)r)r xrrrr Xsz2_BinaryPlistParser._read_object..)rrrrrrrrrrrM timedeltarrrrr extendreziprrr)rrefresultoffsettokentokenHrrr7robj_refskey_refskorrrrs~                      z_BinaryPlistParser._read_objectN) rr+r,__doc__rrtrrrr rrrrrrs   rcCs(|dkrdS|dkr dS|dkrdSdS)Nrrr.rr)countrrr_count_to_sizeqsr0c@r)_BinaryPlistWritercCs||_||_||_dSr)rrr)rrrrrrrrs z_BinaryPlistWriter.__init__c Csg|_i|_i|_||t|j}dg||_t||_t|j|_ |j d|jD]}| |q-| |}|j }t|}dt||}|j tj|g|jRd}|||j|||f} |j tjdg| RdS)Nr bplist00rZz >5xBBBQQQ)_objlist _objtable _objidtable_flattenr2rr0rr _ref_formatrr _write_object _getrefnumtellrpack) rrwrobjrrr offset_format sort_versionrrrrrs*           z_BinaryPlistWriter.writec Cs$t|trt||f|jvrdSn t||jvrdSt|j}|j|t|tr4||jt||f<n||jt|<t|t r}g}g}| }|j rOt |}|D]\}}t|t sb|jr^qQtd||||qQt||D]}||qsdSt|ttfr|D] }||qdSdS)Nr)r_scalarsrr4idr5r2r3r3rrrrr?rr itertoolschainr6rr) rrwrefnumkeysvaluesrr)vr*rrrr6s@           z_BinaryPlistWriter._flattencCs*t|tr|jt||fS|jt|Sr)rr?r4rr5r@rrrrr9s z_BinaryPlistWriter._getrefnumcCs|dkr|jtd||BdS|dkr&|jtd|dBd|dS|dkr:|jtd|dBd|dS|d krN|jtd |dBd |dS|jtd |dBd |dS)Nrz>Br,z>BBBrr-z>BBHr.z>BBLz>BBQ)rrrr;)rr%rrrr _write_sizes    z_BinaryPlistWriter._write_sizec sj|}jj|<|durjddS|dur%jddS|dur1jddSt|tr|dkrVzjtdd|WdStj yUt |dw|d krgjtd d |dS|d krxjtd d|dS|dkrjtdd|dS|dkrjtdd|dS|dkrjd|j d ddddSt |t|t rĈjtdd|dSt|t j r|t ddd}jtdd|dSt|ttfrdt|j|dSt|tr0z|d}dt|Wnty'|d }d!t|d"Ynwj|dSt|tr|jdkr@td#|jd krSjtd d$|dS|jd krfjtd d%|dS|jdkryjtdd&|dS|jdkrjtdd'|dSt |t|ttfrfd(d)|D}t|}d*|jtjd+j|g|RdSt|tr1gg}}jrt|} n|} | D]%\} } t| tsj rqt!d,|"| |"| qt|}d-|jtjd+j|g|Rjtjd+j|g|RdSt!|).NFTrr z>BqrIr,z>BBrr-z>BHrGr.z>BLrHlz>BQrrrz>Bdrrrrrrrrrrrrcsg|]}|qSr)r9)r r*rrr 6sz4_BinaryPlistWriter._write_object..rrZrr)#r9rr:rrrrrr;rrto_bytesrrM total_secondsrrrJr2r?rAUnicodeEncodeErrorrrrrrr7rrrrrrr3) rrwr"rtrefsr7keyRefsvalRefs rootItemsr)rFrrrr8s                (     $(z _BinaryPlistWriter._write_objectN) rr+r,rrr6r9rJr8rrrrr1s-* r1cCs|dddkS)Nrr2r)rrrr_is_fmt_binaryTrrZ)detectriwriterfmtrgcCsj|dur%|d}|dtD]}|d|r |d}nqtnt|d}||d}||S)zRead a .plist file. 'fp' should be a readable and binary file object. Return the unpacked root object (which usually is a dictionary). Nrr r[ri)rg)rr_FORMATSrErrt)rr^rgrinfoPprrrrjs       rcCst|}t|||dS)zqRead a .plist file from a bytes object. Return the unpacked root object (which usually is a dictionary). r])r r)rwr^rgrrrrrsrTF)r^rrcCs:|tvr td|ft|d|||d}||dS)zWWrite 'value' to a .plist file. 'fp' should be a writable, binary file object. zUnsupported format: %rr\)rrN)r_rr)rwrr^rrr\rrrrsrr^rrcCs t}t|||||d|S)z?Return a bytes object with the contents for a .plist file. rc)r rgetvalue)rwr^rrrrrrrsr)r-):r+__all__r4rrMenumior rArrerxml.parsers.expatr Enumrr globalsupdate __members__rrrcompiler[r=rBASCIIrJrSrUr`rarrrrrrobjectrrr0r?rrrr?r1rZrrrr_rrrrrrrrsn8  !     n&^!' U