HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/netaddr/__pycache__/core.cpython-39.pyc
a

��gV�@s�dZddlZddlZddlmZmZejdkZ	dZ
ZdZZ
dZZdZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZzdZe��[dd�ZWney�dd�ZYn0Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)z6Common code shared between various netaddr sub modules�N)�	_callable�_iter_dict_keys�big����c@seZdZdZdS)�AddrFormatErrorzO
    An Exception indicating a network address is not correctly formatted.
    N��__name__�
__module__�__qualname__�__doc__�rr�0/usr/lib/python3.9/site-packages/netaddr/core.pyr	sr	c@seZdZdZdS)�AddrConversionErrorz^
    An Exception indicating a failure to convert between address types or
    notations.
    Nr
rrrrr&src@seZdZdZdS)�NotRegisteredErrorz\
    An Exception indicating that an OUI or IAB was not found in the IEEE
    Registry.
    Nr
rrrrr.sr�*cCs|��S)��
        :param int_val: an unsigned integer.

        :return: the minimum number of bits needed to represent value provided.
        )�
bit_length)�int_valrrr�num_bits;srcCsd}|r|d7}|dL}q|S)rrrr)rZnumbitsrrrrDs

c@seZdZdZdd�ZdS)�
SubscriberzK
    An abstract class defining the interface expected by a Publisher.
    cCstd��dS)��
        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!N)�NotImplementedError��self�datarrr�updateVszSubscriber.updateN)rrr
rrrrrrrQsrc@s(eZdZdZejdfdd�Zdd�ZdS)�
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.
    TcCs||_||_dS)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)rr r!rrr�__init__iszPrettyPrinter.__init__cCs(|j�t�|��|jr$|j�d�dS)r�
N)r �write�_pprint�pformatr!rrrrrwszPrettyPrinter.updateN)rrr
r�_sys�stdoutr"rrrrrr`src@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	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.
    cCs
g|_dS)ZConstructorN)�subscribers�rrrrr"�szPublisher.__init__cCs<t|d�r,t|j�r,||jvr8|j�|�ntd|��dS)z�
        Add a new subscriber.

        :param subscriber: a new object that implements the Subscriber object
            interface.
        rz'%r does not support required interface!N)�hasattrrrr*�append�	TypeError�r�
subscriberrrr�attach�s
zPublisher.attachcCs(z|j�|�Wnty"Yn0dS)z�
        Remove an existing subscriber.

        :param subscriber: a new object that implements the Subscriber object
            interface.
        N)r*�remove�
ValueErrorr/rrr�detach�szPublisher.detachcCs|jD]}|�|�qdS)z�
        Send update data to to all registered Subscribers.

        :param data: the data to be passed to each registered Subscriber.
        N)r*r)rrr0rrr�notify�s
zPublisher.notifyN)rrr
rr"r1r4r5rrrrr)�s

r)c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
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/

    cCs�|D]�}t||t�r*t||�|j|<qt||ttf�r~g}||D](}t|t�rf|�t|��qH|�|�qH||j|<q|||j|<qdS�N)�
isinstance�dictr6�__dict__�list�tupler-)r�d�k�l�vrrrr"�s
zDictDotLookup.__init__cCs||jvr|j|SdSr7)r:)r�namerrr�__getitem__�s
zDictDotLookup.__getitem__cCs
t|j�Sr7)rr:r+rrr�__iter__�szDictDotLookup.__iter__cCst�|j�Sr7)r%r&r:r+rrr�__repr__�szDictDotLookup.__repr__N)rrr
rr"rBrCrDrrrrr6�s
	r6)r�sysr'Zpprintr%Znetaddr.compatrr�	byteorderZBIG_ENDIAN_PLATFORM�PZ	INET_PTON�ZZZEROFILL�NZNOHOSTZ	INET_ATON�	Exceptionr	rr�arr�AttributeError�objectrrr)r6rrrr�<module>s,

#.