Your IP : 3.149.251.22
o
6��fPL � @ s� d Z ddlmZmZ ddlmZ ddlmZ ddlZddl Z ddl
Z
dZdZdd � Z
ed
g d��Zde_ e
jd
krIdej_ dej_ dej_ dej_ G dd� de�ZG dd� ded�ZG dd� de�ZG dd� de�ZG dd� de�Zee d�rG dd� de�Zee d �r�G d!d"� d"e�Zee d#�r�G d$d%� d%e�Zee d&�r�G d'd(� d(e�Zd)d*� Zed&�r�eZdS ed �r�eZdS ed#�r�eZdS ed�r�eZdS eZdS )+z|Selectors module.
This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
� )�ABCMeta�abstractmethod)�
namedtuple)�MappingN� � c
C s` t | t�r| }nzt| �� �}W n tttfy" td�| ��d�w |dk r.td�|���|S )z�Return a file descriptor from a file object.
Parameters:
fileobj -- file object or file descriptor
Returns:
corresponding file descriptor
Raises:
ValueError if the object is invalid
zInvalid file object: {!r}Nr zInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError� TypeError�
ValueError�format)�fileobj�fd� r �0/opt/alt/python310/lib64/python3.10/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 @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )�_SelectorMappingz)Mapping of file objects to selector keys.c C s
|| _ d S �N)� _selector)�self�selectorr r r �__init__@ �
z_SelectorMapping.__init__c C � t | jj�S r )�lenr �
_fd_to_key�r r r r �__len__C � z_SelectorMapping.__len__c C s: z
| j �|�}| j j| W S ty td�|��d �w �N�{!r} is not registered)r �_fileobj_lookupr"