%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/netaddr/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/netaddr/__pycache__/core.cpython-312.pyc

�

���^
��@�dZddlZddlZddlmZmZejdk(Z	dxZ
ZdxZZ
dxZZGd�d	e�ZGd
�de�ZGd�d
e�Z	dZej+�d�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Zy#e$rd�ZY�7wxYw)z6Common code shared between various netaddr sub modules�N)�	_callable�_iter_dict_keys�big���c��eZdZdZy)�AddrFormatErrorzO
    An Exception indicating a network address is not correctly formatted.
    N��__name__�
__module__�__qualname__�__doc__���./usr/lib/python3/dist-packages/netaddr/core.pyr
r
s���	rr
c��eZdZdZy)�AddrConversionErrorz^
    An Exception indicating a failure to convert between address types or
    notations.
    Nrrrrrr#����	rrc��eZdZdZy)�NotRegisteredErrorz\
    An Exception indicating that an OUI or IAB was not found in the IEEE
    Registry.
    Nrrrrrr+rrr�*c�"�|j�S)��
        :param int_val: an unsigned integer.

        :return: the minimum number of bits needed to represent value provided.
        )�
bit_length)�int_vals r�num_bitsr7s���!�!�#�#rc�(�d}|r
|dz
}|dz}|r�
|S)rrrr)r�numbitss  rrr@s*������q�L�G���M�G���rc��eZdZdZd�Zy)�
SubscriberzK
    An abstract class defining the interface expected by a Publisher.
    c��td��)��
        A callback method used by a Publisher to notify this Subscriber about
        updates.

        :param data: a Python object containing data provided by Publisher.
        zcannot invoke virtual method!)�NotImplementedError��self�datas  r�updatezSubscriber.updateRs��"�"A�B�BrN)rr
rrr(rrrr!r!Ms
���Crr!c�6�eZdZdZej
dfd�Zd�Zy)�
PrettyPrinterz�
    A concrete Subscriber that employs the pprint in the standard library to
    format all data from updates received, writing them to a file-like
    object.

    Useful as a debugging aid.
    Tc� �||_||_y)z�
        Constructor.

        :param fh: a file-like object to write updates to.
            Default: sys.stdout.


        :param write_eol: if ``True`` this object will write newlines to
            output, if ``False`` it will not.
        N)�fh�	write_eol)r&r,r-s   r�__init__zPrettyPrinter.__init__es�����"��rc��|jjtj|��|jr|jjd�yy)r#�
N)r,�write�_pprint�pformatr-r%s  rr(zPrettyPrinter.updatess9��	
���
�
�g�o�o�d�+�,��>�>��G�G�M�M�$��rN)rr
rr�_sys�stdoutr.r(rrrr*r*\s����+�+��#�	 rr*c�(�eZdZdZd�Zd�Zd�Zd�Zy)�	Publisherz�
    A 'push' Publisher that maintains a list of Subscriber objects notifying
    them of state changes by passing them update data when it encounter events
    of interest.
    c��g|_y)�ConstructorN)�subscribers�r&s rr.zPublisher.__init__�s
����rc��t|d�r?ttd��r+||jvr|jj	|�yytd|z��)z�
        Add a new subscriber.

        :param subscriber: a new object that implements the Subscriber object
            interface.
        r(zsubscriber.updatez'%r does not support required interface!N)�hasattrr�evalr:�append�	TypeError�r&�
subscribers  r�attachzPublisher.attach�sU���:�x�(�Y�t�<O�7P�-Q���!1�!1�1�� � �'�'�
�3�2��E�
�R�S�Src�Z�	|jj|�y#t$rYywxYw)z�
        Remove an existing subscriber.

        :param subscriber: a new object that implements the Subscriber object
            interface.
        N)r:�remove�
ValueErrorrAs  r�detachzPublisher.detach�s-��	����#�#�J�/���	��	�s��	*�*c�H�|jD]}|j|��y)z�
        Send update data to to all registered Subscribers.

        :param data: the data to be passed to each registered Subscriber.
        N)r:r()r&r'rBs   r�notifyzPublisher.notify�s'���*�*�	$�J����d�#�	$rN)rr
rrr.rCrGrIrrrr7r7s����T�
�$rr7c�(�eZdZdZd�Zd�Zd�Zd�Zy)�
DictDotLookupa
    Creates objects that behave much like a dictionaries, but allow nested
    key access using object '.' (dot) lookups.

    Recipe 576586: Dot-style nested lookups over dictionary based data
    structures - http://code.activestate.com/recipes/576586/

    c�v�|D]�}t||t�rt||�|j|<�2t||tt
f�rXg}||D]>}t|t�r|j
t|���.|j
|��@||j|<��|||j|<��y�N)�
isinstance�dictrK�__dict__�list�tupler?)r&�d�k�l�vs     rr.zDictDotLookup.__init__�s����	(�A��!�A�$��%�#0��1��#6��
�
�a� ��A�a�D�4��-�0����1��$�A�!�!�T�*�����q�!1�2������	$�
$%��
�
�a� �#$�Q�4��
�
�a� �	(rc�>�||jvr|j|SyrM)rP)r&�names  r�__getitem__zDictDotLookup.__getitem__�s"���4�=�=� ��=�=��&�&�!rc�,�t|j�SrM)rrPr;s r�__iter__zDictDotLookup.__iter__�s���t�}�}�-�-rc�@�tj|j�SrM)r2r3rPr;s r�__repr__zDictDotLookup.__repr__�s�����t�}�}�-�-rN)rr
rrr.rYr[r]rrrrKrK�s���
(�'�.�.rrK)r�sysr4�pprintr2�netaddr.compatrr�	byteorder�BIG_ENDIAN_PLATFORM�P�	INET_PTON�Z�ZEROFILL�N�NOHOST�	Exceptionr
rr�arr�AttributeError�objectr!r*r7rKrrr�<module>rms���=���5��n�n��-�����I����H����F�
	�i�	�	�)�	�	��	��
�A��L�L�N�$�,C��C�  �J�  �F+$��+$�\!.�F�!.��_��
��s�B�B�B

Zerion Mini Shell 1.0