Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/internet/__pycache__/pollreactor.cpython-39.pyc
Ðазад
a k�hV � @ s� d Z ddlZddlmZmZmZmZmZmZ m Z ddlmZ ddl mZ ddlmZ ddlmZ ee�G dd � d ejej��Zd d� Zd dgZdS )z� A poll() based implementation of the twisted main loop. To install the event loop (and you should do this before any connections, listeners or connectors are added):: from twisted.internet import pollreactor pollreactor.install() � N)�POLLERR�POLLHUP�POLLIN�POLLNVAL�POLLOUT�error�poll)�implementer)� posixbase)� IReactorFDSet)�logc @ s� e Zd ZdZeeB eB ZeZ e Zdd� Zdd� Z dd� Zdd � Zd d� Zdd � Zdd� Zdd� Zdd� ZeZdd� Zdd� ZdS )�PollReactora^ A reactor that uses poll(2). @ivar _poller: A L{select.poll} which will be used to check for I/O readiness. @ivar _selectables: A dictionary mapping integer file descriptors to instances of L{FileDescriptor} which have been registered with the reactor. All L{FileDescriptor}s which are currently receiving read or write readiness notifications will be present as values in this dictionary. @ivar _reads: A dictionary mapping integer file descriptors to arbitrary values (this is essentially a set). Keys in this dictionary will be registered with C{_poller} for read readiness notifications which will be dispatched to the corresponding L{FileDescriptor} instances in C{_selectables}. @ivar _writes: A dictionary mapping integer file descriptors to arbitrary values (this is essentially a set). Keys in this dictionary will be registered with C{_poller} for write readiness notifications which will be dispatched to the corresponding L{FileDescriptor} instances in C{_selectables}. c C s* t � | _i | _i | _i | _tj�| � dS )zo Initialize polling object, file descriptor tracking dictionaries, and the base class. N)r �_poller�_selectables�_reads�_writesr �PosixReactorBase�__init__��self� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/internet/pollreactor.pyr C s zPollReactor.__init__c C sz z| j �|� W n ty" Y n0 d}|| jv r:|tB }|| jv rL|tB }|dkrd| j �||� n|| jv rv| j|= dS )z*Register/unregister an fd with the poller.r N) r � unregister�KeyErrorr r r r �registerr )r �fd�maskr r r �_updateRegistrationN s zPollReactor._updateRegistrationc C sj z|� � }|| W n8 tyL | j�� D ]\}}||u r, qHq,Y d S Y n0 ||v rf||= | �|� d S )N)�fileno� BaseExceptionr �itemsr )r � selectableZmdictr Zfdesr r r �_dictRemove` s zPollReactor._dictRemovec C s4 |� � }|| jvr0|| j|<