| Server IP : 185.125.27.153 / Your IP : 216.73.216.193 Web Server : Apache System : Linux d6e05399ed1f11695f7c56648ed78c66 6.1.0-0.deb11.50-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1~deb11u1 (2026-07-02) x86_64 User : uid174255 ( 174255) PHP Version : 8.3.31 Disable Function : exec,passthru,pcntl_exec,popen,proc_open,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/netaddr/__pycache__/ |
Upload File : |
a
�xX
� @ s� d Z ddlZddlZddlmZmZ ejdkZ d Z
Zd ZZ
d ZZG dd � d e�ZG d
d� de�ZG dd
� d
e�ZzdZe�� dd� ZW n ey� dd� ZY n0 G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZdS )z6Common code shared between various netaddr sub modules� N)� _callable�_iter_dict_keysZbig� � � c @ s e Zd ZdZdS )�AddrFormatErrorzO
An Exception indicating a network address is not correctly formatted.
N��__name__�
__module__�__qualname__�__doc__� r
r
�./usr/lib/python3/dist-packages/netaddr/core.pyr s r c @ s e Zd ZdZdS )�AddrConversionErrorz^
An Exception indicating a failure to convert between address types or
notations.
Nr r
r
r
r r # s r c @ s e Zd ZdZdS )�NotRegisteredErrorz\
An Exception indicating that an OUI or IAB was not found in the IEEE
Registry.
Nr r
r
r
r r + s r �* c C s | � � S )��
:param int_val: an unsigned integer.
:return: the minimum number of bits needed to represent value provided.
)�
bit_length)�int_valr
r
r �num_bits7 s r c C s d}| r|d7 }| dL } q|S )r r r r
)r Znumbitsr
r
r r @ s
c @ s e Zd ZdZdd� ZdS )�
SubscriberzK
An abstract class defining the interface expected by a Publisher.
c C s t d��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�datar
r
r �updateR s zSubscriber.updateN)r r
r r r r
r
r
r r M s r c @ s( e Zd ZdZejdfdd�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.
Tc C s || _ || _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)r r r r
r
r �__init__e s zPrettyPrinter.__init__c C s( | j �t�|�� | jr$| j �d� dS )r �
N)r �write�_pprint�pformatr r r
r
r r s s zPrettyPrinter.updateN)r r
r r �_sys�stdoutr r r
r
r
r r \ s r c @ s0 e Zd ZdZdd� 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.
c C s
g | _ dS )ZConstructorN)�subscribers�r r
r
r r � s zPublisher.__init__c C s>