Hacked By AnonymousFox
a
R�fPL � @ s� d dl mZmZ d dlmZ d dlmZ d dlZd dlZd dl Z dZ
dZdd� Zed g d
��Z
de
_e jdkr�d
e
j_de
j_de
j_de
j_G dd� de�ZG dd� ded�ZG dd� de�ZG dd� de�ZG dd� de�Zeed�r�G dd� de�Zeed��rG d d!� d!e�Zeed"��r2G d#d$� d$e�Zeed%��rNG d&d'� d'e�Zd(d)� Zed%��rfeZn4ed��rveZn$ed"��r�eZned��r�eZneZdS )*� )�ABCMeta�abstractmethod)�
namedtuple)�MappingN� � c
C sd t | t�r| }n:zt| �� �}W n( tttfyH td�| ��d �Y n0 |dk r`td�|���|S )NzInvalid file object: {!r}r zInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError� TypeError�
ValueError�format)�fileobj�fd� r �./opt/alt/python39/lib64/python3.9/selectors.py�_fileobj_to_fd s
��r �SelectorKey)r r �events�dataz�SelectorKey(fileobj, fd, events, data)
Object used to associate a file object to its backing
file descriptor, selected event mask, and attached data.
)� � zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
For example, this could be used to store a per-client session ID.c @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S )
�_SelectorMappingc C s
|| _ d S �N)� _selector)�self�selectorr r r �__init__@ s z_SelectorMapping.__init__c C s t | jj�S r )�lenr �
_fd_to_key�r r r r �__len__C s z_SelectorMapping.__len__c C sB z| j �|�}| j j| W S ty< td�|��d �Y n0 d S �N�{!r} is not registered)r �_fileobj_lookupr �KeyErrorr )r r r r r r �__getitem__F s
z_SelectorMapping.__getitem__c C s t | jj�S r )�iterr r r! r r r �__iter__M s z_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__r r"