Back
Type Name Operations
__future__.cpython-36.opt-1.pyc
__future__.cpython-36.opt-2.pyc
__future__.cpython-36.pyc
__phello__.foo.cpython-36.opt-1.pyc
__phello__.foo.cpython-36.opt-2.pyc
__phello__.foo.cpython-36.pyc
_bootlocale.cpython-36.opt-1.pyc
_bootlocale.cpython-36.opt-2.pyc
_bootlocale.cpython-36.pyc
_collections_abc.cpython-36.opt-1.pyc
_collections_abc.cpython-36.opt-2.pyc
_collections_abc.cpython-36.pyc
_compat_pickle.cpython-36.opt-1.pyc
_compat_pickle.cpython-36.opt-2.pyc
_compat_pickle.cpython-36.pyc
_compression.cpython-36.opt-1.pyc
_compression.cpython-36.opt-2.pyc
_compression.cpython-36.pyc
_dummy_thread.cpython-36.opt-1.pyc
_dummy_thread.cpython-36.opt-2.pyc
_dummy_thread.cpython-36.pyc
_markupbase.cpython-36.opt-1.pyc
_markupbase.cpython-36.opt-2.pyc
_markupbase.cpython-36.pyc
_osx_support.cpython-36.opt-1.pyc
_osx_support.cpython-36.opt-2.pyc
_osx_support.cpython-36.pyc
_pydecimal.cpython-36.opt-1.pyc
_pydecimal.cpython-36.opt-2.pyc
_pydecimal.cpython-36.pyc
_pyio.cpython-36.opt-1.pyc
_pyio.cpython-36.opt-2.pyc
_pyio.cpython-36.pyc
_sitebuiltins.cpython-36.opt-1.pyc
_sitebuiltins.cpython-36.opt-2.pyc
_sitebuiltins.cpython-36.pyc
_strptime.cpython-36.opt-1.pyc
_strptime.cpython-36.opt-2.pyc
_strptime.cpython-36.pyc
_sysconfigdata_dm_linux_x86_64-linux-gnu.cpython-36.opt-1.pyc
_sysconfigdata_dm_linux_x86_64-linux-gnu.cpython-36.opt-2.pyc
_sysconfigdata_dm_linux_x86_64-linux-gnu.cpython-36.pyc
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.opt-1.pyc
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.opt-2.pyc
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc
_threading_local.cpython-36.opt-1.pyc
_threading_local.cpython-36.opt-2.pyc
_threading_local.cpython-36.pyc
_weakrefset.cpython-36.opt-1.pyc
_weakrefset.cpython-36.opt-2.pyc
_weakrefset.cpython-36.pyc
abc.cpython-36.opt-1.pyc
abc.cpython-36.opt-2.pyc
abc.cpython-36.pyc
aifc.cpython-36.opt-1.pyc
aifc.cpython-36.opt-2.pyc
aifc.cpython-36.pyc
antigravity.cpython-36.opt-1.pyc
antigravity.cpython-36.opt-2.pyc
antigravity.cpython-36.pyc
argparse.cpython-36.opt-1.pyc
argparse.cpython-36.opt-2.pyc
argparse.cpython-36.pyc
ast.cpython-36.opt-1.pyc
ast.cpython-36.opt-2.pyc
ast.cpython-36.pyc
asynchat.cpython-36.opt-1.pyc
asynchat.cpython-36.opt-2.pyc
asynchat.cpython-36.pyc
asyncore.cpython-36.opt-1.pyc
asyncore.cpython-36.opt-2.pyc
asyncore.cpython-36.pyc
base64.cpython-36.opt-1.pyc
base64.cpython-36.opt-2.pyc
base64.cpython-36.pyc
bdb.cpython-36.opt-1.pyc
bdb.cpython-36.opt-2.pyc
bdb.cpython-36.pyc
binhex.cpython-36.opt-1.pyc
binhex.cpython-36.opt-2.pyc
binhex.cpython-36.pyc
bisect.cpython-36.opt-1.pyc
bisect.cpython-36.opt-2.pyc
bisect.cpython-36.pyc
bz2.cpython-36.opt-1.pyc
bz2.cpython-36.opt-2.pyc
bz2.cpython-36.pyc
cProfile.cpython-36.opt-1.pyc
cProfile.cpython-36.opt-2.pyc
cProfile.cpython-36.pyc
calendar.cpython-36.opt-1.pyc
calendar.cpython-36.opt-2.pyc
calendar.cpython-36.pyc
cgi.cpython-36.opt-1.pyc
cgi.cpython-36.opt-2.pyc
cgi.cpython-36.pyc
cgitb.cpython-36.opt-1.pyc
cgitb.cpython-36.opt-2.pyc
cgitb.cpython-36.pyc
chunk.cpython-36.opt-1.pyc
chunk.cpython-36.opt-2.pyc
chunk.cpython-36.pyc
cmd.cpython-36.opt-1.pyc
cmd.cpython-36.opt-2.pyc
cmd.cpython-36.pyc
code.cpython-36.opt-1.pyc
code.cpython-36.opt-2.pyc
code.cpython-36.pyc
codecs.cpython-36.opt-1.pyc
codecs.cpython-36.opt-2.pyc
codecs.cpython-36.pyc
codeop.cpython-36.opt-1.pyc
codeop.cpython-36.opt-2.pyc
codeop.cpython-36.pyc
colorsys.cpython-36.opt-1.pyc
colorsys.cpython-36.opt-2.pyc
colorsys.cpython-36.pyc
compileall.cpython-36.opt-1.pyc
compileall.cpython-36.opt-2.pyc
compileall.cpython-36.pyc
configparser.cpython-36.opt-1.pyc
configparser.cpython-36.opt-2.pyc
configparser.cpython-36.pyc
contextlib.cpython-36.opt-1.pyc
contextlib.cpython-36.opt-2.pyc
contextlib.cpython-36.pyc
copy.cpython-36.opt-1.pyc
copy.cpython-36.opt-2.pyc
copy.cpython-36.pyc
copyreg.cpython-36.opt-1.pyc
copyreg.cpython-36.opt-2.pyc
copyreg.cpython-36.pyc
crypt.cpython-36.opt-1.pyc
crypt.cpython-36.opt-2.pyc
crypt.cpython-36.pyc
csv.cpython-36.opt-1.pyc
csv.cpython-36.opt-2.pyc
csv.cpython-36.pyc
datetime.cpython-36.opt-1.pyc
datetime.cpython-36.opt-2.pyc
datetime.cpython-36.pyc
decimal.cpython-36.opt-1.pyc
decimal.cpython-36.opt-2.pyc
decimal.cpython-36.pyc
difflib.cpython-36.opt-1.pyc
difflib.cpython-36.opt-2.pyc
difflib.cpython-36.pyc
dis.cpython-36.opt-1.pyc
dis.cpython-36.opt-2.pyc
dis.cpython-36.pyc
doctest.cpython-36.opt-1.pyc
doctest.cpython-36.opt-2.pyc
doctest.cpython-36.pyc
dummy_threading.cpython-36.opt-1.pyc
dummy_threading.cpython-36.opt-2.pyc
dummy_threading.cpython-36.pyc
enum.cpython-36.opt-1.pyc
enum.cpython-36.opt-2.pyc
enum.cpython-36.pyc
filecmp.cpython-36.opt-1.pyc
filecmp.cpython-36.opt-2.pyc
filecmp.cpython-36.pyc
fileinput.cpython-36.opt-1.pyc
fileinput.cpython-36.opt-2.pyc
fileinput.cpython-36.pyc
fnmatch.cpython-36.opt-1.pyc
fnmatch.cpython-36.opt-2.pyc
fnmatch.cpython-36.pyc
formatter.cpython-36.opt-1.pyc
formatter.cpython-36.opt-2.pyc
formatter.cpython-36.pyc
fractions.cpython-36.opt-1.pyc
fractions.cpython-36.opt-2.pyc
fractions.cpython-36.pyc
ftplib.cpython-36.opt-1.pyc
ftplib.cpython-36.opt-2.pyc
ftplib.cpython-36.pyc
functools.cpython-36.opt-1.pyc
functools.cpython-36.opt-2.pyc
functools.cpython-36.pyc
genericpath.cpython-36.opt-1.pyc
genericpath.cpython-36.opt-2.pyc
genericpath.cpython-36.pyc
getopt.cpython-36.opt-1.pyc
getopt.cpython-36.opt-2.pyc
getopt.cpython-36.pyc
getpass.cpython-36.opt-1.pyc
getpass.cpython-36.opt-2.pyc
getpass.cpython-36.pyc
gettext.cpython-36.opt-1.pyc
gettext.cpython-36.opt-2.pyc
gettext.cpython-36.pyc
glob.cpython-36.opt-1.pyc
glob.cpython-36.opt-2.pyc
glob.cpython-36.pyc
gzip.cpython-36.opt-1.pyc
gzip.cpython-36.opt-2.pyc
gzip.cpython-36.pyc
hashlib.cpython-36.opt-1.pyc
hashlib.cpython-36.opt-2.pyc
hashlib.cpython-36.pyc
heapq.cpython-36.opt-1.pyc
heapq.cpython-36.opt-2.pyc
heapq.cpython-36.pyc
hmac.cpython-36.opt-1.pyc
hmac.cpython-36.opt-2.pyc
hmac.cpython-36.pyc
imaplib.cpython-36.opt-1.pyc
imaplib.cpython-36.opt-2.pyc
imaplib.cpython-36.pyc
imghdr.cpython-36.opt-1.pyc
imghdr.cpython-36.opt-2.pyc
imghdr.cpython-36.pyc
imp.cpython-36.opt-1.pyc
imp.cpython-36.opt-2.pyc
imp.cpython-36.pyc
inspect.cpython-36.opt-1.pyc
inspect.cpython-36.opt-2.pyc
inspect.cpython-36.pyc
io.cpython-36.opt-1.pyc
io.cpython-36.opt-2.pyc
io.cpython-36.pyc
ipaddress.cpython-36.opt-1.pyc
ipaddress.cpython-36.opt-2.pyc
ipaddress.cpython-36.pyc
keyword.cpython-36.opt-1.pyc
keyword.cpython-36.opt-2.pyc
keyword.cpython-36.pyc
linecache.cpython-36.opt-1.pyc
linecache.cpython-36.opt-2.pyc
linecache.cpython-36.pyc
locale.cpython-36.opt-1.pyc
locale.cpython-36.opt-2.pyc
locale.cpython-36.pyc
lzma.cpython-36.opt-1.pyc
lzma.cpython-36.opt-2.pyc
lzma.cpython-36.pyc
macpath.cpython-36.opt-1.pyc
macpath.cpython-36.opt-2.pyc
macpath.cpython-36.pyc
macurl2path.cpython-36.opt-1.pyc
macurl2path.cpython-36.opt-2.pyc
macurl2path.cpython-36.pyc
mailbox.cpython-36.opt-1.pyc
mailbox.cpython-36.opt-2.pyc
mailbox.cpython-36.pyc
mailcap.cpython-36.opt-1.pyc
mailcap.cpython-36.opt-2.pyc
mailcap.cpython-36.pyc
mimetypes.cpython-36.opt-1.pyc
mimetypes.cpython-36.opt-2.pyc
mimetypes.cpython-36.pyc
modulefinder.cpython-36.opt-1.pyc
modulefinder.cpython-36.opt-2.pyc
modulefinder.cpython-36.pyc
netrc.cpython-36.opt-1.pyc
netrc.cpython-36.opt-2.pyc
netrc.cpython-36.pyc
nntplib.cpython-36.opt-1.pyc
nntplib.cpython-36.opt-2.pyc
nntplib.cpython-36.pyc
ntpath.cpython-36.opt-1.pyc
ntpath.cpython-36.opt-2.pyc
ntpath.cpython-36.pyc
nturl2path.cpython-36.opt-1.pyc
nturl2path.cpython-36.opt-2.pyc
nturl2path.cpython-36.pyc
numbers.cpython-36.opt-1.pyc
numbers.cpython-36.opt-2.pyc
numbers.cpython-36.pyc
opcode.cpython-36.opt-1.pyc
opcode.cpython-36.opt-2.pyc
opcode.cpython-36.pyc
operator.cpython-36.opt-1.pyc
operator.cpython-36.opt-2.pyc
operator.cpython-36.pyc
optparse.cpython-36.opt-1.pyc
optparse.cpython-36.opt-2.pyc
optparse.cpython-36.pyc
os.cpython-36.opt-1.pyc
os.cpython-36.opt-2.pyc
os.cpython-36.pyc
pathlib.cpython-36.opt-1.pyc
pathlib.cpython-36.opt-2.pyc
pathlib.cpython-36.pyc
pdb.cpython-36.opt-1.pyc
pdb.cpython-36.opt-2.pyc
pdb.cpython-36.pyc
pickle.cpython-36.opt-1.pyc
pickle.cpython-36.opt-2.pyc
pickle.cpython-36.pyc
pickletools.cpython-36.opt-1.pyc
pickletools.cpython-36.opt-2.pyc
pickletools.cpython-36.pyc
pipes.cpython-36.opt-1.pyc
pipes.cpython-36.opt-2.pyc
pipes.cpython-36.pyc
pkgutil.cpython-36.opt-1.pyc
pkgutil.cpython-36.opt-2.pyc
pkgutil.cpython-36.pyc
platform.cpython-36.opt-1.pyc
platform.cpython-36.opt-2.pyc
platform.cpython-36.pyc
plistlib.cpython-36.opt-1.pyc
plistlib.cpython-36.opt-2.pyc
plistlib.cpython-36.pyc
poplib.cpython-36.opt-1.pyc
poplib.cpython-36.opt-2.pyc
poplib.cpython-36.pyc
posixpath.cpython-36.opt-1.pyc
posixpath.cpython-36.opt-2.pyc
posixpath.cpython-36.pyc
pprint.cpython-36.opt-1.pyc
pprint.cpython-36.opt-2.pyc
pprint.cpython-36.pyc
profile.cpython-36.opt-1.pyc
profile.cpython-36.opt-2.pyc
profile.cpython-36.pyc
pstats.cpython-36.opt-1.pyc
pstats.cpython-36.opt-2.pyc
pstats.cpython-36.pyc
pty.cpython-36.opt-1.pyc
pty.cpython-36.opt-2.pyc
pty.cpython-36.pyc
py_compile.cpython-36.opt-1.pyc
py_compile.cpython-36.opt-2.pyc
py_compile.cpython-36.pyc
pyclbr.cpython-36.opt-1.pyc
pyclbr.cpython-36.opt-2.pyc
pyclbr.cpython-36.pyc
pydoc.cpython-36.opt-1.pyc
pydoc.cpython-36.opt-2.pyc
pydoc.cpython-36.pyc
queue.cpython-36.opt-1.pyc
queue.cpython-36.opt-2.pyc
queue.cpython-36.pyc
quopri.cpython-36.opt-1.pyc
quopri.cpython-36.opt-2.pyc
quopri.cpython-36.pyc
random.cpython-36.opt-1.pyc
random.cpython-36.opt-2.pyc
random.cpython-36.pyc
re.cpython-36.opt-1.pyc
re.cpython-36.opt-2.pyc
re.cpython-36.pyc
reprlib.cpython-36.opt-1.pyc
reprlib.cpython-36.opt-2.pyc
reprlib.cpython-36.pyc
rlcompleter.cpython-36.opt-1.pyc
rlcompleter.cpython-36.opt-2.pyc
rlcompleter.cpython-36.pyc
runpy.cpython-36.opt-1.pyc
runpy.cpython-36.opt-2.pyc
runpy.cpython-36.pyc
sched.cpython-36.opt-1.pyc
sched.cpython-36.opt-2.pyc
sched.cpython-36.pyc
secrets.cpython-36.opt-1.pyc
secrets.cpython-36.opt-2.pyc
secrets.cpython-36.pyc
selectors.cpython-36.opt-1.pyc
selectors.cpython-36.opt-2.pyc
selectors.cpython-36.pyc
shelve.cpython-36.opt-1.pyc
shelve.cpython-36.opt-2.pyc
shelve.cpython-36.pyc
shlex.cpython-36.opt-1.pyc
shlex.cpython-36.opt-2.pyc
shlex.cpython-36.pyc
shutil.cpython-36.opt-1.pyc
shutil.cpython-36.opt-2.pyc
shutil.cpython-36.pyc
signal.cpython-36.opt-1.pyc
signal.cpython-36.opt-2.pyc
signal.cpython-36.pyc
site.cpython-36.opt-1.pyc
site.cpython-36.opt-2.pyc
site.cpython-36.pyc
smtpd.cpython-36.opt-1.pyc
smtpd.cpython-36.opt-2.pyc
smtpd.cpython-36.pyc
smtplib.cpython-36.opt-1.pyc
smtplib.cpython-36.opt-2.pyc
smtplib.cpython-36.pyc
sndhdr.cpython-36.opt-1.pyc
sndhdr.cpython-36.opt-2.pyc
sndhdr.cpython-36.pyc
socket.cpython-36.opt-1.pyc
socket.cpython-36.opt-2.pyc
socket.cpython-36.pyc
socketserver.cpython-36.opt-1.pyc
socketserver.cpython-36.opt-2.pyc
socketserver.cpython-36.pyc
sre_compile.cpython-36.opt-1.pyc
sre_compile.cpython-36.opt-2.pyc
sre_compile.cpython-36.pyc
sre_constants.cpython-36.opt-1.pyc
sre_constants.cpython-36.opt-2.pyc
sre_constants.cpython-36.pyc
sre_parse.cpython-36.opt-1.pyc
sre_parse.cpython-36.opt-2.pyc
sre_parse.cpython-36.pyc
ssl.cpython-36.opt-1.pyc
ssl.cpython-36.opt-2.pyc
ssl.cpython-36.pyc
stat.cpython-36.opt-1.pyc
stat.cpython-36.opt-2.pyc
stat.cpython-36.pyc
statistics.cpython-36.opt-1.pyc
statistics.cpython-36.opt-2.pyc
statistics.cpython-36.pyc
string.cpython-36.opt-1.pyc
string.cpython-36.opt-2.pyc
string.cpython-36.pyc
stringprep.cpython-36.opt-1.pyc
stringprep.cpython-36.opt-2.pyc
stringprep.cpython-36.pyc
struct.cpython-36.opt-1.pyc
struct.cpython-36.opt-2.pyc
struct.cpython-36.pyc
subprocess.cpython-36.opt-1.pyc
subprocess.cpython-36.opt-2.pyc
subprocess.cpython-36.pyc
sunau.cpython-36.opt-1.pyc
sunau.cpython-36.opt-2.pyc
sunau.cpython-36.pyc
symbol.cpython-36.opt-1.pyc
symbol.cpython-36.opt-2.pyc
symbol.cpython-36.pyc
symtable.cpython-36.opt-1.pyc
symtable.cpython-36.opt-2.pyc
symtable.cpython-36.pyc
sysconfig.cpython-36.opt-1.pyc
sysconfig.cpython-36.opt-2.pyc
sysconfig.cpython-36.pyc
tabnanny.cpython-36.opt-1.pyc
tabnanny.cpython-36.opt-2.pyc
tabnanny.cpython-36.pyc
tarfile.cpython-36.opt-1.pyc
tarfile.cpython-36.opt-2.pyc
tarfile.cpython-36.pyc
telnetlib.cpython-36.opt-1.pyc
telnetlib.cpython-36.opt-2.pyc
telnetlib.cpython-36.pyc
tempfile.cpython-36.opt-1.pyc
tempfile.cpython-36.opt-2.pyc
tempfile.cpython-36.pyc
textwrap.cpython-36.opt-1.pyc
textwrap.cpython-36.opt-2.pyc
textwrap.cpython-36.pyc
this.cpython-36.opt-1.pyc
this.cpython-36.opt-2.pyc
this.cpython-36.pyc
threading.cpython-36.opt-1.pyc
threading.cpython-36.opt-2.pyc
threading.cpython-36.pyc
timeit.cpython-36.opt-1.pyc
timeit.cpython-36.opt-2.pyc
timeit.cpython-36.pyc
token.cpython-36.opt-1.pyc
token.cpython-36.opt-2.pyc
token.cpython-36.pyc
tokenize.cpython-36.opt-1.pyc
tokenize.cpython-36.opt-2.pyc
tokenize.cpython-36.pyc
trace.cpython-36.opt-1.pyc
trace.cpython-36.opt-2.pyc
trace.cpython-36.pyc
traceback.cpython-36.opt-1.pyc
traceback.cpython-36.opt-2.pyc
traceback.cpython-36.pyc
tracemalloc.cpython-36.opt-1.pyc
tracemalloc.cpython-36.opt-2.pyc
tracemalloc.cpython-36.pyc
tty.cpython-36.opt-1.pyc
tty.cpython-36.opt-2.pyc
tty.cpython-36.pyc
types.cpython-36.opt-1.pyc
types.cpython-36.opt-2.pyc
types.cpython-36.pyc
typing.cpython-36.opt-1.pyc
typing.cpython-36.opt-2.pyc
typing.cpython-36.pyc
uu.cpython-36.opt-1.pyc
uu.cpython-36.opt-2.pyc
uu.cpython-36.pyc
uuid.cpython-36.opt-1.pyc
uuid.cpython-36.opt-2.pyc
uuid.cpython-36.pyc
warnings.cpython-36.opt-1.pyc
warnings.cpython-36.opt-2.pyc
warnings.cpython-36.pyc
wave.cpython-36.opt-1.pyc
wave.cpython-36.opt-2.pyc
wave.cpython-36.pyc
weakref.cpython-36.opt-1.pyc
weakref.cpython-36.opt-2.pyc
weakref.cpython-36.pyc
webbrowser.cpython-36.opt-1.pyc
webbrowser.cpython-36.opt-2.pyc
webbrowser.cpython-36.pyc
xdrlib.cpython-36.opt-1.pyc
xdrlib.cpython-36.opt-2.pyc
xdrlib.cpython-36.pyc
zipapp.cpython-36.opt-1.pyc
zipapp.cpython-36.opt-2.pyc
zipapp.cpython-36.pyc
zipfile.cpython-36.opt-1.pyc
zipfile.cpython-36.opt-2.pyc
zipfile.cpython-36.pyc

File Transfer

Upload files to current directory

File Editor: selectors.cpython-36.pyc

3 \K@sdZddlmZmZddlmZmZddlZddlZddl Z d)Z d*Z ddZ edd d d d gZ d e _e jd+krde j_de j_de j_de j_GdddeZGdddedZGdddeZGdddeZeedrGdddeZeed rGd!d"d"eZeed#r"Gd$d%d%eZeed&r>Gd'd(d(eZd(ekrPeZn:d"ekrbeZn(d%ekrteZndekreZneZdS),z|Selectors module. This module allows high-level and efficient I/O multiplexing, built upon the `select` module primitives. )ABCMetaabstractmethod) namedtupleMappingNc Csft|tr|}nsz_SelectorMapping.__init__cCs t|jjS)N)lenr _fd_to_key)rrrr__len__Asz_SelectorMapping.__len__c CsBy|jj|}|jj|Stk r<tdj|dYnXdS)Nz{!r} is not registered)r_fileobj_lookuprKeyErrorr )rrrrrr __getitem__Ds   z_SelectorMapping.__getitem__cCs t|jjS)N)iterrr)rrrr__iter__Ksz_SelectorMapping.__iter__N)__name__ __module__ __qualname____doc__rrr!r#rrrrr;s rc@sneZdZdZedddZeddZdddZedd d Zd d Z d dZ eddZ ddZ ddZ dS) BaseSelectora-Selector abstract base class. A selector supports registering file objects to be monitored for specific I/O events. A file object is a file descriptor or any object with a `fileno()` method. An arbitrary object can be attached to the file object, which can be used for example to store context information, a callback, etc. A selector can use various implementations (select(), poll(), epoll()...) depending on the platform. The default `Selector` class uses the most efficient implementation on the current platform. NcCstdS)a3Register a file object. Parameters: fileobj -- file object or file descriptor events -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE) data -- attached data Returns: SelectorKey instance Raises: ValueError if events is invalid KeyError if fileobj is already registered OSError if fileobj is closed or otherwise is unacceptable to the underlying system call (if a system call is made) Note: OSError may or may not be raised N)NotImplementedError)rrrrrrrregister^szBaseSelector.registercCstdS)ajUnregister a file object. Parameters: fileobj -- file object or file descriptor Returns: SelectorKey instance Raises: KeyError if fileobj is not registered Note: If fileobj is registered but has since been closed this does *not* raise OSError (even if the wrapped syscall does) N)r))rrrrr unregisteruszBaseSelector.unregistercCs|j||j|||S)ayChange a registered file object monitored events or attached data. Parameters: fileobj -- file object or file descriptor events -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE) data -- attached data Returns: SelectorKey instance Raises: Anything that unregister() or register() raises )r+r*)rrrrrrrmodifys zBaseSelector.modifycCstdS)aqPerform the actual selection, until some monitored file objects are ready or a timeout expires. Parameters: timeout -- if timeout > 0, this specifies the maximum wait time, in seconds if timeout <= 0, the select() call won't block, and will report the currently ready file objects if timeout is None, select() will block until a monitored file object becomes ready Returns: list of (key, events) for ready file objects `events` is a bitwise mask of EVENT_READ|EVENT_WRITE N)r))rtimeoutrrrselectszBaseSelector.selectcCsdS)zmClose the selector. This must be called to make sure that any underlying resource is freed. Nr)rrrrcloseszBaseSelector.closec CsJ|j}|dkrtdy||Stk rDtdj|dYnXdS)zzReturn the key associated to a registered file object. Returns: SelectorKey for this file object NzSelector is closedz{!r} is not registered)get_map RuntimeErrorr r )rrmappingrrrget_keyszBaseSelector.get_keycCstdS)z2Return a mapping of file objects to selector keys.N)r))rrrrr0szBaseSelector.get_mapcCs|S)Nr)rrrr __enter__szBaseSelector.__enter__cGs |jdS)N)r/)rargsrrr__exit__szBaseSelector.__exit__)N)N)N)r$r%r&r'rr*r+r,r.r/r3r0r4r6rrrrr(Os      r() metaclassc@sTeZdZdZddZddZdddZd d Zdd d Zd dZ ddZ ddZ dS)_BaseSelectorImplzBase selector implementation.cCsi|_t||_dS)N)rr_map)rrrrrsz_BaseSelectorImpl.__init__c CsHyt|Stk rBx"|jjD]}|j|kr$|jSq$WYnXdS)alReturn a file descriptor from a file object. This wraps _fileobj_to_fd() to do an exhaustive search in case the object is invalid but we still have it in our map. This is used by unregister() so we can unregister an object that was previously registered even if it is closed. It is also used by _SelectorMapping. N)rr rvaluesrr)rrkeyrrrrs   z!_BaseSelectorImpl._fileobj_lookupNcCsd| s|ttB@r"tdj|t||j|||}|j|jkrTtdj||j||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered) EVENT_READ EVENT_WRITEr r rrrrr )rrrrr;rrrr*s   z_BaseSelectorImpl.registerc Cs@y|jj|j|}Wn$tk r:tdj|dYnX|S)Nz{!r} is not registered)rpoprr r )rrr;rrrr+s z_BaseSelectorImpl.unregisterc Csy|j|j|}Wn$tk r8tdj|dYnX||jkr^|j||j|||}n"||jkr|j|d}||j|j <|S)Nz{!r} is not registered)r) rrr r rr+r*r_replacer)rrrrr;rrrr,s     z_BaseSelectorImpl.modifycCs|jjd|_dS)N)rclearr9)rrrrr/ s z_BaseSelectorImpl.closecCs|jS)N)r9)rrrrr0sz_BaseSelectorImpl.get_mapc Cs$y |j|Stk rdSXdS)zReturn the key associated to a given file descriptor. Parameters: fd -- file descriptor Returns: corresponding key, or None if not found N)rr )rrrrr _key_from_fds  z_BaseSelectorImpl._key_from_fd)N)N) r$r%r&r'rrr*r+r,r/r0rArrrrr8s  r8cs`eZdZdZfddZdfdd ZfddZejd krHdd d Z ne j Z dd d Z Z S)SelectSelectorzSelect-based selector.cstjt|_t|_dS)N)superrset_readers_writers)r) __class__rrr%s zSelectSelector.__init__Ncs@tj|||}|t@r&|jj|j|t@r<|jj|j|S)N)rCr*r<rEaddrr=rF)rrrrr;)rGrrr**s zSelectSelector.registercs,tj|}|jj|j|jj|j|S)N)rCr+rEdiscardrrF)rrr;)rGrrr+2s zSelectSelector.unregisterZwin32cCs$tj||||\}}}|||gfS)N)r.)rrw_r-xrrr_select9szSelectSelector._selectc Cs|dkr dnt|d}g}y|j|j|jg|\}}}Wntk rL|SXt|}t|}xV||BD]J}d}||kr|tO}||kr|tO}|j|}|rh|j |||j @fqhW|S)Nr) maxrNrErFInterruptedErrorrDr<r=rAappendr) rr-readyrJrKrLrrr;rrrr.?s$ zSelectSelector.select)N)N)N) r$r%r&r'rr*r+sysplatformrNr. __classcell__rr)rGrrB"s    rBpollcsDeZdZdZfddZd fdd ZfddZd d d ZZS) PollSelectorzPoll-based selector.cstjtj|_dS)N)rCrr.rV_poll)r)rGrrrZs zPollSelector.__init__NcsLtj|||}d}|t@r&|tjO}|t@r8|tjO}|jj|j||S)Nr) rCr*r<r.POLLINr=POLLOUTrXr)rrrrr; poll_events)rGrrr*^s  zPollSelector.registercstj|}|jj|j|S)N)rCr+rXr)rrr;)rGrrr+hs zPollSelector.unregisterc Cs|dkrd}n|dkrd}ntj|d}g}y|jj|}Wntk rR|SXx^|D]V\}}d}|tj@rz|tO}|tj@r|t O}|j |}|rZ|j |||j @fqZW|S)Nrg@@) mathceilrXrVrPr.rYr=rZr<rArQr)rr-rR fd_event_listreventrr;rrrr.ms(   zPollSelector.select)N)N) r$r%r&r'rr*r+r.rUrr)rGrrWWs   rWepollcsXeZdZdZfddZddZdfdd Zfd d Zdd d Zfd dZ Z S) EpollSelectorzEpoll-based selector.cstjtj|_dS)N)rCrr.r`_epoll)r)rGrrrs zEpollSelector.__init__cCs |jjS)N)rbr )rrrrr szEpollSelector.filenoNc sttj|||}d}|t@r&|tjO}|t@r8|tjO}y|jj|j|Wn"t k rntj |YnX|S)Nr) rCr*r<r.EPOLLINr=EPOLLOUTrbr BaseExceptionr+)rrrrr;Z epoll_events)rGrrr*s   zEpollSelector.registerc s8tj|}y|jj|jWntk r2YnX|S)N)rCr+rbrOSError)rrr;)rGrrr+s  zEpollSelector.unregisterc Cs|dkrd}n |dkrd}ntj|dd}tt|jd}g}y|jj||}Wntk rh|SXx^|D]V\}}d}|tj @r|t O}|tj @r|t O}|j |}|rp|j|||j@fqpW|S)Nrrg@@gMbP?)r\r]rOrrrbrVrPr.rcr=rdr<rArQr) rr-max_evrRr^rr_rr;rrrr.s*   zEpollSelector.selectcs|jjtjdS)N)rbr/rC)r)rGrrr/s zEpollSelector.close)N)N) r$r%r&r'rr r*r+r.r/rUrr)rGrras  radevpollcsXeZdZdZfddZddZdfdd Zfd d Zdd d Zfd dZ Z S)DevpollSelectorzSolaris /dev/poll selector.cstjtj|_dS)N)rCrr.ri_devpoll)r)rGrrrs zDevpollSelector.__init__cCs |jjS)N)rkr )rrrrr szDevpollSelector.filenoNcsLtj|||}d}|t@r&|tjO}|t@r8|tjO}|jj|j||S)Nr) rCr*r<r.rYr=rZrkr)rrrrr;r[)rGrrr*s  zDevpollSelector.registercstj|}|jj|j|S)N)rCr+rkr)rrr;)rGrrr+s zDevpollSelector.unregisterc Cs|dkrd}n|dkrd}ntj|d}g}y|jj|}Wntk rR|SXx^|D]V\}}d}|tj@rz|tO}|tj@r|t O}|j |}|rZ|j |||j @fqZW|S)Nrg@@) r\r]rkrVrPr.rYr=rZr<rArQr)rr-rRr^rr_rr;rrrr.s(   zDevpollSelector.selectcs|jjtjdS)N)rkr/rC)r)rGrrr/s zDevpollSelector.close)N)N) r$r%r&r'rr r*r+r.r/rUrr)rGrrjs   rjkqueuecsXeZdZdZfddZddZdfdd Zfd d Zdd d Zfd dZ Z S)KqueueSelectorzKqueue-based selector.cstjtj|_dS)N)rCrr.rl_kqueue)r)rGrrrs zKqueueSelector.__init__cCs |jjS)N)rnr )rrrrr szKqueueSelector.filenoNc stj|||}y`|t@r@tj|jtjtj}|jj |gdd|t @rntj|jtj tj}|jj |gddWn"t k rtj |YnX|S)Nr)rCr*r<r.keventrKQ_FILTER_READZ KQ_EV_ADDrncontrolr=KQ_FILTER_WRITErer+)rrrrr;kev)rGrrr*s   zKqueueSelector.registercstj|}|jt@rVtj|jtjtj}y|j j |gddWnt k rTYnX|jt @rtj|jtj tj}y|j j |gddWnt k rYnX|S)Nr)rCr+rr<r.rorrpZ KQ_EV_DELETErnrqrfr=rr)rrr;rs)rGrrr+'s      zKqueueSelector.unregisterc Cs|dkr dnt|d}t|j}g}y|jjd||}Wntk rL|SXxb|D]Z}|j}|j}d}|tj krz|t O}|tj kr|t O}|j |} | rT|j| || j@fqTW|S)Nr)rOrrrnrqrPZidentfilterr.rpr<rrr=rArQr) rr-rhrRZkev_listrsrflagrr;rrrr.<s&     zKqueueSelector.selectcs|jjtjdS)N)rnr/rC)r)rGrrr/Rs zKqueueSelector.close)N)N) r$r%r&r'rr r*r+r.r/rUrr)rGrrm s   rmr)rr)r'abcrr collectionsrrr\r.rSr<r=rr version_inforrrrrr(r8rBhasattrrWrarjrmglobalsZDefaultSelectorrrrrsH ~U3 1 G 8 M