ok
Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/ |
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/plistlib.cpython-311.pyc |
� �f�n � �� � d Z g d�ZddlZddlZddlZddlZddlmZ ddlZddl Z ddl Z ddlZddlm Z ej dde�� � Z e� � � ej � � G d � d � � ZdZ e j d� � Zd2d�Zd� Z e j de j � � Zd� Zd� Zd� Z G d� d� � Z G d� d� � Z G d� de � � Z!d� Z" G d� de#� � Z$dddd d!�Z% e&� � Z' G d"� d#� � Z(d$� Z)e*e+e,ej e-fZ. G d%� d&e&� � Z/d'� Z0e1 e2e"ee!�(� � e3 e2e0e(e/�(� � iZ4de2d)�d*�Z5de2d)�d+�Z6e1d,d-d.�d/�Z7e1d-d,d0�d1�Z8dS )3a> 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 = "<hello & hi there!>", aThirdString = "M\xe4ssig, Ma\xdf", aTrueValue = True, aFalseValue = False, ), someData = b"<binary gunk>", someMoreData = b"<lots of binary gunk>" * 10, aDate = datetime.datetime.now() ) print(plistlib.dumps(pl).decode()) Parse Plist example: import plistlib plist = b'''<plist version="1.0"> <dict> <key>foo</key> <string>bar</string> </dict> </plist>''' pl = plistlib.loads(plist) print(pl["foo"]) )�InvalidFileException�FMT_XML� FMT_BINARY�load�dump�loads�dumps�UID� N)�BytesIO)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec �2 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� ZdS )r c � � t |t � � st d� � �|dk rt d� � �|dk rt d� � �|| _ d S )Nzdata must be an int� zUIDs cannot be >= 2**64r �UIDs must be positive)� isinstance�int� TypeError� ValueError�data��selfr s �//opt/alt/python311/lib64/python3.11/plistlib.py�__init__zUID.__init__N s^ � ��$��$�$� 3��1�2�2�2��7�?�?��6�7�7�7��!�8�8��4�5�5�5��� � � � c � � | j S �N)r �r s r � __index__z UID.__index__W s � ��y�r c �J � | j j �dt | j � � �d�S )N�(�))� __class__�__name__�reprr r s r �__repr__zUID.__repr__Z s$ � ��>�2�2�2�D���O�O�O�O�D�Dr c � � | j | j ffS r )r$ r r s r � __reduce__zUID.__reduce__] s � ��~�� �|�+�+r c �Z � t |t � � st S | j |j k S r )r r �NotImplementedr )r �others r �__eq__z UID.__eq__` s) � ��%��%�%� "�!�!��y�E�J�&�&r c �* � t | j � � S r )�hashr r s r �__hash__zUID.__hash__e s � ��D�I���r N) r% � __module__�__qualname__r r r'