Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/netaddr/__pycache__/core.cpython-39.pyc
Ðазад
a ^�h � @ 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_keys�big� � � c @ s e Zd ZdZdS )�AddrFormatErrorzO An Exception indicating a network address is not correctly formatted. N��__name__� __module__�__qualname__�__doc__� r r �|/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-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>