/snap/core20/2866/usr/lib/python3.8/__pycache__
NameSizeModeActions
abc.cpython-38.pyc53340644editdlrm
aifc.cpython-38.pyc254740644editdlrm
antigravity.cpython-38.pyc7970644editdlrm
argparse.cpython-38.pyc625910644editdlrm
ast.cpython-38.pyc167630644editdlrm
asynchat.cpython-38.pyc68510644editdlrm
asyncore.cpython-38.pyc160280644editdlrm
base64.cpython-38.pyc170710644editdlrm
bdb.cpython-38.pyc249210644editdlrm
binhex.cpython-38.pyc121340644editdlrm
bisect.cpython-38.pyc23540644editdlrm
bz2.cpython-38.pyc114450644editdlrm
calendar.cpython-38.pyc270640644editdlrm
cgi.cpython-38.pyc265440644editdlrm
cgitb.cpython-38.pyc101500644editdlrm
chunk.cpython-38.pyc48390644editdlrm
cmd.cpython-38.pyc126260644editdlrm
code.cpython-38.pyc99130644editdlrm
codecs.cpython-38.pyc339560644editdlrm
codeop.cpython-38.pyc64170644editdlrm
colorsys.cpython-38.pyc32400644editdlrm
compileall.cpython-38.pyc94100644editdlrm
configparser.cpython-38.pyc457180644editdlrm
contextlib.cpython-38.pyc202290644editdlrm
contextvars.cpython-38.pyc2430644editdlrm
copy.cpython-38.pyc69870644editdlrm
copyreg.cpython-38.pyc43180644editdlrm
cProfile.cpython-38.pyc54800644editdlrm
crypt.cpython-38.pyc33870644editdlrm
csv.cpython-38.pyc119100644editdlrm
dataclasses.cpython-38.pyc236530644editdlrm
datetime.cpython-38.pyc571730644editdlrm
decimal.cpython-38.pyc3590644editdlrm
difflib.cpython-38.pyc594380644editdlrm
dis.cpython-38.pyc158080644editdlrm
doctest.cpython-38.pyc759740644editdlrm
dummy_threading.cpython-38.pyc11100644editdlrm
enum.cpython-38.pyc259620644editdlrm
filecmp.cpython-38.pyc84270644editdlrm
fileinput.cpython-38.pyc133730644editdlrm
fnmatch.cpython-38.pyc33550644editdlrm
formatter.cpython-38.pyc175450644editdlrm
fractions.cpython-38.pyc187390644editdlrm
ftplib.cpython-38.pyc280070644editdlrm
functools.cpython-38.pyc279010644editdlrm
genericpath.cpython-38.pyc40010644editdlrm
getopt.cpython-38.pyc62710644editdlrm
getpass.cpython-38.pyc41780644editdlrm
gettext.cpython-38.pyc180000644editdlrm
glob.cpython-38.pyc43430644editdlrm
gzip.cpython-38.pyc181840644editdlrm
hashlib.cpython-38.pyc67270644editdlrm
heapq.cpython-38.pyc140700644editdlrm
hmac.cpython-38.pyc63880644editdlrm
imaplib.cpython-38.pyc413420644editdlrm
imghdr.cpython-38.pyc41180644editdlrm
imp.cpython-38.pyc98090644editdlrm
inspect.cpython-38.pyc805930644editdlrm
io.cpython-38.pyc34540644editdlrm
ipaddress.cpython-38.pyc628290644editdlrm
keyword.cpython-38.pyc9980644editdlrm
linecache.cpython-38.pyc38670644editdlrm
locale.cpython-38.pyc346740644editdlrm
lzma.cpython-38.pyc120180644editdlrm
mailbox.cpython-38.pyc602640644editdlrm
mailcap.cpython-38.pyc72060644editdlrm
mimetypes.cpython-38.pyc160310644editdlrm
modulefinder.cpython-38.pyc161150644editdlrm
netrc.cpython-38.pyc37770644editdlrm
nntplib.cpython-38.pyc339740644editdlrm
ntpath.cpython-38.pyc140910644editdlrm
nturl2path.cpython-38.pyc17440644editdlrm
numbers.cpython-38.pyc122020644editdlrm
opcode.cpython-38.pyc54200644editdlrm
operator.cpython-38.pyc136910644editdlrm
optparse.cpython-38.pyc480570644editdlrm
os.cpython-38.pyc313970644editdlrm
pathlib.cpython-38.pyc442090644editdlrm
pdb.cpython-38.pyc472260644editdlrm
pickle.cpython-38.pyc469080644editdlrm
pickletools.cpython-38.pyc672040644editdlrm
pipes.cpython-38.pyc77950644editdlrm
pkgutil.cpython-38.pyc163090644editdlrm
platform.cpython-38.pyc243260644editdlrm
plistlib.cpython-38.pyc273740644editdlrm
poplib.cpython-38.pyc134590644editdlrm
posixpath.cpython-38.pyc104610644editdlrm
pprint.cpython-38.pyc162810644editdlrm
profile.cpython-38.pyc147580644editdlrm
pstats.cpython-38.pyc220660644editdlrm
pty.cpython-38.pyc39550644editdlrm
pyclbr.cpython-38.pyc104510644editdlrm
pydoc.cpython-38.pyc836460644editdlrm
py_compile.cpython-38.pyc73520644editdlrm
queue.cpython-38.pyc106260644editdlrm
quopri.cpython-38.pyc57480644editdlrm
random.cpython-38.pyc201080644editdlrm
re.cpython-38.pyc144220644editdlrm
reprlib.cpython-38.pyc53030644editdlrm
rlcompleter.cpython-38.pyc57550644editdlrm
runpy.cpython-38.pyc81810644editdlrm
sched.cpython-38.pyc65320644editdlrm
secrets.cpython-38.pyc21900644editdlrm
selectors.cpython-38.pyc169350644editdlrm
shelve.cpython-38.pyc94900644editdlrm
shlex.cpython-38.pyc75360644editdlrm
shutil.cpython-38.pyc372190644editdlrm
signal.cpython-38.pyc28430644editdlrm
site.cpython-38.pyc171680644editdlrm
sitecustomize.cpython-38.pyc2200644editdlrm
smtpd.cpython-38.pyc264630644editdlrm
smtplib.cpython-38.pyc355320644editdlrm
sndhdr.cpython-38.pyc69890644editdlrm
socket.cpython-38.pyc277870644editdlrm
socketserver.cpython-38.pyc253610644editdlrm
sre_compile.cpython-38.pyc151420644editdlrm
sre_constants.cpython-38.pyc63590644editdlrm
sre_parse.cpython-38.pyc216470644editdlrm
ssl.cpython-38.pyc450370644editdlrm
stat.cpython-38.pyc43720644editdlrm
statistics.cpython-38.pyc336530644editdlrm
string.cpython-38.pyc73000644editdlrm
stringprep.cpython-38.pyc110170644editdlrm
struct.cpython-38.pyc3300644editdlrm
subprocess.cpython-38.pyc419670644editdlrm
sunau.cpython-38.pyc170800644editdlrm
symbol.cpython-38.pyc24040644editdlrm
symtable.cpython-38.pyc113220644editdlrm
sysconfig.cpython-38.pyc158370644editdlrm
tabnanny.cpython-38.pyc70300644editdlrm
tarfile.cpython-38.pyc630430644editdlrm
telnetlib.cpython-38.pyc182370644editdlrm
tempfile.cpython-38.pyc266530644editdlrm
textwrap.cpython-38.pyc135190644editdlrm
this.cpython-38.pyc12610644editdlrm
threading.cpython-38.pyc399760644editdlrm
timeit.cpython-38.pyc117770644editdlrm
token.cpython-38.pyc24850644editdlrm
tokenize.cpython-38.pyc171600644editdlrm
trace.cpython-38.pyc200260644editdlrm
traceback.cpython-38.pyc199380644editdlrm
tracemalloc.cpython-38.pyc173630644editdlrm
tty.cpython-38.pyc10760644editdlrm
turtle.cpython-38.pyc1300220644editdlrm
types.cpython-38.pyc91770644editdlrm
typing.cpython-38.pyc624200644editdlrm
uu.cpython-38.pyc36050644editdlrm
uuid.cpython-38.pyc236830644editdlrm
warnings.cpython-38.pyc136520644editdlrm
wave.cpython-38.pyc181490644editdlrm
weakref.cpython-38.pyc195180644editdlrm
webbrowser.cpython-38.pyc171200644editdlrm
xdrlib.cpython-38.pyc82210644editdlrm
zipapp.cpython-38.pyc58540644editdlrm
zipfile.cpython-38.pyc593360644editdlrm
zipimport.cpython-38.pyc172750644editdlrm
_bootlocale.cpython-38.pyc12430644editdlrm
_collections_abc.cpython-38.pyc287410644editdlrm
_compat_pickle.cpython-38.pyc55010644editdlrm
_compression.cpython-38.pyc41460644editdlrm
_dummy_thread.cpython-38.pyc60370644editdlrm
_markupbase.cpython-38.pyc77900644editdlrm
_osx_support.cpython-38.pyc115930644editdlrm
_pydecimal.cpython-38.pyc1607350644editdlrm
_pyio.cpython-38.pyc740790644editdlrm
_py_abc.cpython-38.pyc46700644editdlrm
_sitebuiltins.cpython-38.pyc34810644editdlrm
_strptime.cpython-38.pyc160440644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.pyc211210644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-38.pyc211150644editdlrm
_threading_local.cpython-38.pyc64460644editdlrm
_weakrefset.cpython-38.pyc76000644editdlrm
__future__.cpython-38.pyc41580644editdlrm
__phello__.foo.cpython-38.pyc1270644editdlrm
Edit: /snap/core20/2866/usr/lib/python3.8/__pycache__/asyncore.cpython-38.pyc (16028B)
U ¼Ê¦i~Nã@shdZddlZddlZddlZddlZddlZddlZddlmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZee e eeeehƒZzeWnek r¤iZYnXdd„ZGdd„deƒZeeefZdd „Zd d „Z d d „Z!dd„Z"d&dd„Z#d'dd„Z$e$Z%d(dd„Z&Gdd„dƒZ'Gdd„de'ƒZ(dd„Z)d)dd „Z*ej+d!krdGd"d#„d#ƒZ,Gd$d%„d%e'ƒZ-dS)*a Basic infrastructure for asynchronous socket service clients and servers. There are only two ways to have a program on a single processor do "more than one thing at a time". Multi-threaded programming is the simplest and most popular way to do it, but there is another very different technique, that lets you have nearly all the advantages of multi-threading, without actually using multiple threads. it's really only practical if your program is largely I/O bound. If your program is CPU bound, then pre-emptive scheduled threads are probably what you really need. Network servers are rarely CPU-bound, however. If your operating system supports the select() system call in its I/O library (and nearly all do), then you can use it to juggle multiple communication channels at once; doing other work while your I/O is taking place in the "background." Although this strategy can seem strange and complex, especially at first, it is in many ways easier to understand and control than multi-threaded programming. The module documented here solves many of the difficult problems for you, making the task of building sophisticated high-performance network servers and clients a snap. éN) ÚEALREADYÚ EINPROGRESSÚ EWOULDBLOCKÚ ECONNRESETÚEINVALÚENOTCONNÚ ESHUTDOWNÚEISCONNÚEBADFÚ ECONNABORTEDÚEPIPEÚEAGAINÚ errorcodec CsHz t |¡WStttfk rB|tkr6t|YSd|YSXdS)NzUnknown error %s)ÚosÚstrerrorÚ ValueErrorÚ OverflowErrorÚ NameErrorr)Úerr©rú/usr/lib/python3.8/asyncore.pyÚ _strerrorDs   rc@s eZdZdS)ÚExitNowN)Ú__name__Ú __module__Ú __qualname__rrrrrLsrcCs:z | ¡Wn(tk r"‚Yn| ¡YnXdS©N)Úhandle_read_eventÚ_reraised_exceptionsÚ handle_error©ÚobjrrrÚreadQs  r"cCs:z | ¡Wn(tk r"‚Yn| ¡YnXdSr)Úhandle_write_eventrrr rrrÚwriteYs  r$cCs:z | ¡Wn(tk r"‚Yn| ¡YnXdSr)Úhandle_expt_eventrrr rrrÚ _exceptionas  r&c CsÆzX|tj@r| ¡|tj@r&| ¡|tj@r8| ¡|tjtjBtj B@rV|  ¡Wnht k rš}z$|j dt kr‚| ¡n|  ¡W5d}~XYn(tk r®‚Yn| ¡YnXdS©Nr)ÚselectÚPOLLINrÚPOLLOUTr#ÚPOLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVALÚ handle_closeÚOSErrorÚargsÚ _DISCONNECTEDrr)r!ÚflagsÚerrrÚ readwriteis"     r2çc Cs<|dkr t}|r8g}g}g}t| ¡ƒD]L\}}| ¡}| ¡}|rP| |¡|rd|jsd| |¡|sl|r*| |¡q*g|kr–|kr–|kr¨nnt |¡dSt   ||||¡\}}}|D] }|  |¡}|dkrÚqÂt |ƒqÂ|D]"}|  |¡}|dkrqèt |ƒqè|D]&}|  |¡}|dkr,qt |ƒqdSr)Ú socket_mapÚlistÚitemsÚreadableÚwritableÚappendÚ acceptingÚtimeÚsleepr(Úgetr"r$r&) ÚtimeoutÚmapÚrÚwr1Úfdr!Zis_rZis_wrrrÚpoll}sD    "        rCcCsÀ|dkr t}|dk r t|dƒ}t ¡}|r¼t| ¡ƒD]L\}}d}| ¡r\|tjtjBO}|  ¡rt|j st|tj O}|r8|  ||¡q8| |¡}|D]&\}}|  |¡}|dkr°q”t||ƒq”dS)Nièr)r4Úintr(rCr5r6r7r)r+r8r:r*Úregisterr=r2)r>r?ZpollsterrBr!r0r@rrrÚpoll2¤s(     rFç>@FcCsb|dkr t}|r ttdƒr t}nt}|dkr>|r^|||ƒq,n |r^|dkr^|||ƒ|d}q>dS)NrCré)r4Úhasattrr(rFrC)r>Zuse_pollr?ÚcountZpoll_funrrrÚloopÀs  rKc@s2eZdZdZdZdZdZdZdZe dhƒZ dAdd„Z dd„Z dBdd „Z dCd d „Zejejfd d „ZdDdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„ZdEd'd(„Zd)d*„Z d+d,„Z!d-d.„Z"d/d0„Z#d1d2„Z$d3d4„Z%d5d6„Z&d7d8„Z'd9d:„Z(d;d<„Z)d=d>„Z*d?d@„Z+dS)FÚ dispatcherFNÚwarningc Cs |dkrt|_n||_d|_|r–| d¡| ||¡d|_z| ¡|_Wqœtk r’}z*|j dt t fkrvd|_n |  |¡‚W5d}~XYqœXnd|_ dS©NrTF)r4Ú_mapÚ_filenoÚ setblockingÚ set_socketÚ connectedZ getpeernameÚaddrr-r.rrÚ del_channelÚsocket)ÚselfÚsockr?rrrrÚ__init__Üs    zdispatcher.__init__cCs˜|jjd|jjg}|jr.|jr.| d¡n|jr>| d¡|jdk r‚z| d|j¡Wn$tk r€| t|jƒ¡YnXdd  |¡t |ƒfS)NÚ.Z listeningrSz%s:%dz <%s at %#x>ú ) Ú __class__rrr:rTr9rSÚ TypeErrorÚreprÚjoinÚid)rWZstatusrrrÚ__repr__üs    zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrrÚ add_channel szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUs zdispatcher.del_channelcCs.||f|_t ||¡}| d¡| |¡dSr')Zfamily_and_typerVrQrR)rWZfamilyÚtyperXrrrÚ create_sockets   zdispatcher.create_socketcCs||_| ¡|_| |¡dSr)rVÚfilenorPrb©rWrXr?rrrrRs zdispatcher.set_socketcCsDz*|j tjtj|j tjtj¡dB¡Wntk r>YnXdS)NrH)rVZ setsockoptÚ SOL_SOCKETZ SO_REUSEADDRÚ getsockoptr-©rWrrrÚset_reuse_addr#s ÿÿþzdispatcher.set_reuse_addrcCsdS©NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j |¡S)NTÚnté)r:rÚnamerVÚlisten)rWZnumrrrro>szdispatcher.listencCs||_|j |¡Sr)rTrVÚbind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j |¡}|tttfks8|tkrBtj dkrB||_ dS|dt fkr^||_ |  ¡nt |t|ƒ‚dS)NFTrlr)rSÚ connectingrVZ connect_exrrrrrrnrTr Úhandle_connect_eventr-r)rWZaddressrrrrÚconnectHs ÿÿ  zdispatcher.connectc Csvz|j ¡\}}WnVtk r(YdStk rh}z$|jdtttfkrVWY¢ dS‚W5d}~XYn X||fSdSr')rVÚacceptr]r-r.rr r )rWZconnrTÚwhyrrrrtVs zdispatcher.acceptc Cstz|j |¡}|WStk rn}z>|jdtkrz:uncaptured python exception, closing channel %s (%s:%s %s)Úerror)Úcompact_tracebackr^r`r„r,)rWZnilÚtÚvÚtbinfoZ self_reprrrrrÈs üù zdispatcher.handle_errorcCs| dd¡dS)Nz!unhandled incoming priority eventrM©r„rirrrr‹Üszdispatcher.handle_exptcCs| dd¡dS)Nzunhandled read eventrMr‘rirrrr†ßszdispatcher.handle_readcCs| dd¡dS)Nzunhandled write eventrMr‘rirrrrŠâszdispatcher.handle_writecCs| dd¡dS)Nzunhandled connect eventrMr‘rirrrrˆåszdispatcher.handle_connectcCs| ¡}|dk r|j|ŽdSr)rtÚhandle_accepted)rWZpairrrrr…èszdispatcher.handle_acceptcCs| ¡| dd¡dS)Nzunhandled accepted eventrM)r{r„)rWrXrTrrrr’íszdispatcher.handle_acceptedcCs| dd¡| ¡dS)Nzunhandled close eventrM)r„r{rirrrr,ñs zdispatcher.handle_close)NN)N)N)N)r),rrrÚdebugrSr:rqÚclosingrTÚ frozensetr‚rYrarbrUrVZAF_INETZ SOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r€r„rrrr#r%rr‹r†rŠrˆr…r’r,rrrrrLÒsJ         rLc@s6eZdZd dd„Zdd„Zdd„Zdd „Zd d „ZdS) Údispatcher_with_sendNcCst |||¡d|_dS)Nry)rLrYÚ out_bufferrfrrrrYüszdispatcher_with_send.__init__cCs.d}t ||jdd…¡}|j|d…|_dS)Nri)rLrvr—)rWZnum_sentrrrÚ initiate_sendsz"dispatcher_with_send.initiate_sendcCs | ¡dSr)r˜rirrrrŠsz!dispatcher_with_send.handle_writecCs|j pt|jƒSr)rSÚlenr—rirrrr8szdispatcher_with_send.writablecCs0|jr| dt|ƒ¡|j||_| ¡dS)Nz sending %s)r“r„r^r—r˜)rWrwrrrrv s zdispatcher_with_send.send)NN)rrrrYr˜rŠr8rvrrrrr–ús  r–cCs‚t ¡\}}}g}|stdƒ‚|rL| |jjj|jjjt|j ƒf¡|j }q~|d\}}}d  dd„|Dƒ¡}|||f|||fS)Nztraceback does not existéÿÿÿÿr[cSsg|] }d|‘qS)z [%s|%s|%s]r)Ú.0ÚxrrrÚ &sz%compact_traceback..) r|Úexc_infoÚAssertionErrorr9Útb_frameÚf_codeÚ co_filenameÚco_namer~Ú tb_linenoÚtb_nextr_)rŽrÚtbrÚfileZfunctionÚlinerrrrrsýrc Cs”|dkr t}t| ¡ƒD]n}z | ¡Wqtk r`}z|jdtkrJn|sP‚W5d}~XYqtk rt‚Yq|s€‚YqXq| ¡dSr') r4r5Úvaluesr{r-r.r rÚclear)r?Z ignore_allrœrrrÚ close_all)s   r«Úposixc@sNeZdZdd„Zdd„Zdd„Zdd„Zdd d „ZeZeZ d d „Z dd„Z d S)Ú file_wrappercCst |¡|_dSr)rÚduprB©rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d| ¡dS)Nrzunclosed file %r)Úsource)rBÚwarningsÚwarnÚResourceWarningr{rirrrÚ__del__Qs   ÿzfile_wrapper.__del__cGstj|jf|žŽSr)rr"rB©rWr.rrrrzWszfile_wrapper.recvcGstj|jf|žŽSr)rr$rBrµrrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStdƒ‚dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr‡ÚNotImplementedError)rWÚlevelZoptnameZbuflenrrrrh]s ÿþzfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t |¡dS)Nrrš)rBrr{r¯rrrr{hs  zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N) rrrrYr´rzrvrhr"r$r{rerrrrr­Is r­c@seZdZddd„Zdd„ZdS)Úfile_dispatcherNcCsPt |d|¡d|_z | ¡}Wntk r4YnX| |¡t |d¡dS)NTF)rLrYrSreÚAttributeErrorÚset_filerÚ set_blocking)rWrBr?rrrrYts  zfile_dispatcher.__init__cCs"t|ƒ|_|j ¡|_| ¡dSr)r­rVrerPrbr¯rrrrºs  zfile_dispatcher.set_file)N)rrrrYrºrrrrr¸rs r¸)r3N)r3N)rGFNN)NF).Ú__doc__r(rVr|r;r±rÚerrnorrrrrrrr r r r r rr•r/r4rrÚ ExceptionrÚKeyboardInterruptÚ SystemExitrr"r$r&r2rCrFZpoll3rKrLr–rr«rnr­r¸rrrrÚsD< ÿ   '  *  )