/snap/core22/2411/usr/lib/python3.10/__pycache__
NameSizeModeActions
abc.cpython-310.pyc67510644editdlrm
aifc.cpython-310.pyc246850644editdlrm
antigravity.cpython-310.pyc8220644editdlrm
argparse.cpython-310.pyc635390644editdlrm
ast.cpython-310.pyc557390644editdlrm
asynchat.cpython-310.pyc70250644editdlrm
asyncore.cpython-310.pyc160020644editdlrm
base64.cpython-310.pyc171620644editdlrm
bdb.cpython-310.pyc258320644editdlrm
binhex.cpython-310.pyc128700644editdlrm
bisect.cpython-310.pyc25880644editdlrm
bz2.cpython-310.pyc108700644editdlrm
calendar.cpython-310.pyc263030644editdlrm
cgi.cpython-310.pyc267230644editdlrm
cgitb.cpython-310.pyc99980644editdlrm
chunk.cpython-310.pyc48600644editdlrm
cmd.cpython-310.pyc127070644editdlrm
code.cpython-310.pyc99570644editdlrm
codecs.cpython-310.pyc332190644editdlrm
codeop.cpython-310.pyc55950644editdlrm
colorsys.cpython-310.pyc32650644editdlrm
compileall.cpython-310.pyc127330644editdlrm
configparser.cpython-310.pyc454580644editdlrm
contextlib.cpython-310.pyc208950644editdlrm
contextvars.cpython-310.pyc2460644editdlrm
copy.cpython-310.pyc69960644editdlrm
copyreg.cpython-310.pyc46830644editdlrm
cProfile.cpython-310.pyc51130644editdlrm
crypt.cpython-310.pyc35500644editdlrm
csv.cpython-310.pyc117980644editdlrm
dataclasses.cpython-310.pyc265780644editdlrm
datetime.cpython-310.pyc565330644editdlrm
decimal.cpython-310.pyc3620644editdlrm
difflib.cpython-310.pyc589050644editdlrm
dis.cpython-310.pyc156560644editdlrm
doctest.cpython-310.pyc761750644editdlrm
enum.cpython-310.pyc260630644editdlrm
filecmp.cpython-310.pyc87490644editdlrm
fileinput.cpython-310.pyc140720644editdlrm
fnmatch.cpython-310.pyc42440644editdlrm
fractions.cpython-310.pyc186000644editdlrm
ftplib.cpython-310.pyc289770644editdlrm
functools.cpython-310.pyc283350644editdlrm
genericpath.cpython-310.pyc39070644editdlrm
getopt.cpython-310.pyc63390644editdlrm
getpass.cpython-310.pyc42100644editdlrm
gettext.cpython-310.pyc182210644editdlrm
glob.cpython-310.pyc58520644editdlrm
graphlib.cpython-310.pyc76160644editdlrm
gzip.cpython-310.pyc185460644editdlrm
hashlib.cpython-310.pyc68450644editdlrm
heapq.cpython-310.pyc138650644editdlrm
hmac.cpython-310.pyc69730644editdlrm
imaplib.cpython-310.pyc424320644editdlrm
imghdr.cpython-310.pyc39050644editdlrm
imp.cpython-310.pyc97860644editdlrm
inspect.cpython-310.pyc851530644editdlrm
io.cpython-310.pyc36630644editdlrm
ipaddress.cpython-310.pyc626700644editdlrm
keyword.cpython-310.pyc9270644editdlrm
linecache.cpython-310.pyc41420644editdlrm
locale.cpython-310.pyc461540644editdlrm
lzma.cpython-310.pyc121000644editdlrm
mailbox.cpython-310.pyc600910644editdlrm
mailcap.cpython-310.pyc73200644editdlrm
mimetypes.cpython-310.pyc176190644editdlrm
modulefinder.cpython-310.pyc161660644editdlrm
netrc.cpython-310.pyc39330644editdlrm
nntplib.cpython-310.pyc316230644editdlrm
ntpath.cpython-310.pyc147040644editdlrm
nturl2path.cpython-310.pyc17470644editdlrm
numbers.cpython-310.pyc118660644editdlrm
opcode.cpython-310.pyc54470644editdlrm
operator.cpython-310.pyc135080644editdlrm
optparse.cpython-310.pyc477540644editdlrm
os.cpython-310.pyc315990644editdlrm
pathlib.cpython-310.pyc420520644editdlrm
pdb.cpython-310.pyc474400644editdlrm
pickle.cpython-310.pyc468820644editdlrm
pickletools.cpython-310.pyc677600644editdlrm
pipes.cpython-310.pyc77690644editdlrm
pkgutil.cpython-310.pyc183610644editdlrm
platform.cpython-310.pyc274290644editdlrm
plistlib.cpython-310.pyc237650644editdlrm
poplib.cpython-310.pyc136700644editdlrm
posixpath.cpython-310.pyc105600644editdlrm
pprint.cpython-310.pyc178750644editdlrm
profile.cpython-310.pyc143910644editdlrm
pstats.cpython-310.pyc236210644editdlrm
pty.cpython-310.pyc41430644editdlrm
pyclbr.cpython-310.pyc97750644editdlrm
pydoc.cpython-310.pyc856450644editdlrm
py_compile.cpython-310.pyc73390644editdlrm
queue.cpython-310.pyc107920644editdlrm
quopri.cpython-310.pyc57940644editdlrm
random.cpython-310.pyc227480644editdlrm
re.cpython-310.pyc142270644editdlrm
reprlib.cpython-310.pyc52500644editdlrm
rlcompleter.cpython-310.pyc59540644editdlrm
runpy.cpython-310.pyc94110644editdlrm
sched.cpython-310.pyc61150644editdlrm
secrets.cpython-310.pyc21750644editdlrm
selectors.cpython-310.pyc171050644editdlrm
shelve.cpython-310.pyc94920644editdlrm
shlex.cpython-310.pyc77820644editdlrm
shutil.cpython-310.pyc385360644editdlrm
signal.cpython-310.pyc29350644editdlrm
site.cpython-310.pyc179220644editdlrm
sitecustomize.cpython-310.pyc2250644editdlrm
smtpd.cpython-310.pyc261470644editdlrm
smtplib.cpython-310.pyc357660644editdlrm
sndhdr.cpython-310.pyc69620644editdlrm
socket.cpython-310.pyc289630644editdlrm
socketserver.cpython-310.pyc253470644editdlrm
sre_compile.cpython-310.pyc151940644editdlrm
sre_constants.cpython-310.pyc63570644editdlrm
sre_parse.cpython-310.pyc217550644editdlrm
ssl.cpython-310.pyc452710644editdlrm
stat.cpython-310.pyc42730644editdlrm
statistics.cpython-310.pyc370510644editdlrm
string.cpython-310.pyc71020644editdlrm
stringprep.cpython-310.pyc170750644editdlrm
struct.cpython-310.pyc3070644editdlrm
subprocess.cpython-310.pyc447410644editdlrm
sunau.cpython-310.pyc164820644editdlrm
symtable.cpython-310.pyc128350644editdlrm
sysconfig.cpython-310.pyc181510644editdlrm
tabnanny.cpython-310.pyc69500644editdlrm
tarfile.cpython-310.pyc706740644editdlrm
telnetlib.cpython-310.pyc185060644editdlrm
tempfile.cpython-310.pyc273390644editdlrm
textwrap.cpython-310.pyc138120644editdlrm
this.cpython-310.pyc12640644editdlrm
threading.cpython-310.pyc449690644editdlrm
timeit.cpython-310.pyc117690644editdlrm
token.cpython-310.pyc27380644editdlrm
tokenize.cpython-310.pyc171940644editdlrm
trace.cpython-310.pyc198700644editdlrm
traceback.cpython-310.pyc217120644editdlrm
tracemalloc.cpython-310.pyc175250644editdlrm
tty.cpython-310.pyc10790644editdlrm
turtle.cpython-310.pyc1288570644editdlrm
types.cpython-310.pyc95250644editdlrm
typing.cpython-310.pyc852770644editdlrm
uu.cpython-310.pyc38670644editdlrm
uuid.cpython-310.pyc224980644editdlrm
warnings.cpython-310.pyc136460644editdlrm
wave.cpython-310.pyc175940644editdlrm
weakref.cpython-310.pyc203430644editdlrm
webbrowser.cpython-310.pyc170000644editdlrm
xdrlib.cpython-310.pyc78800644editdlrm
zipapp.cpython-310.pyc60130644editdlrm
zipfile.cpython-310.pyc618450644editdlrm
zipimport.cpython-310.pyc170330644editdlrm
_aix_support.cpython-310.pyc28790644editdlrm
_bootsubprocess.cpython-310.pyc22940644editdlrm
_collections_abc.cpython-310.pyc329250644editdlrm
_compat_pickle.cpython-310.pyc58720644editdlrm
_compression.cpython-310.pyc45120644editdlrm
_distutils_system_mod.cpython-310.pyc54220644editdlrm
_markupbase.cpython-310.pyc75720644editdlrm
_osx_support.cpython-310.pyc115350644editdlrm
_pydecimal.cpython-310.pyc1577360644editdlrm
_pyio.cpython-310.pyc736540644editdlrm
_py_abc.cpython-310.pyc46830644editdlrm
_sitebuiltins.cpython-310.pyc35470644editdlrm
_strptime.cpython-310.pyc159450644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc353850644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-310.pyc353790644editdlrm
_threading_local.cpython-310.pyc65390644editdlrm
_weakrefset.cpython-310.pyc76080644editdlrm
__future__.cpython-310.pyc41310644editdlrm
__phello__.foo.cpython-310.pyc1300644editdlrm
Edit: /snap/core22/2411/usr/lib/python3.10/__pycache__/telnetlib.cpython-310.pyc (18506B)
o `€wiÖZã@sNdZddlZddlZddlZddlmZdgZdZdZ e dgƒZ e dgƒZ e dgƒZ e d gƒZe d gƒZe dgƒZe d gƒZe d gƒZe d gƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZe dgƒZ e dgƒZ!e dgƒZ"e dgƒZ#e dgƒZ$e dgƒZ%e dgƒZ&e d gƒZ'e d!gƒZ(e d"gƒZ)e d#gƒZ*e d$gƒZ+e d%gƒZ,e d&gƒZ-e d'gƒZ.e d(gƒZ/e d)gƒZ0e d*gƒZ1e d+gƒZ2e dgƒZ3e d,gƒZ4e d-gƒZ5e d.gƒZ6e d/gƒZ7e d0gƒZ8e d1gƒZ9e d2gƒZ:e d3gƒZ;e d4gƒZe d7gƒZ?e d8gƒZ@e d9gƒZAe d:gƒZBe d;gƒZCe dgƒZFe d?gƒZGe d@gƒZHe dAgƒZIe dBgƒZJe dCgƒZKe dDgƒZLe dEgƒZMe dFgƒZNe dGgƒZOe dHgƒZPe dgƒZQe dgƒZReSedIƒrejTZUnejVZUGdJd„dƒZWdKdL„ZXeYdMkr¥eXƒdSdS)NaQTELNET client class. Based on RFC 854: TELNET Protocol Specification, by J. Postel and J. Reynolds Example: >>> from telnetlib import Telnet >>> tn = Telnet('www.python.org', 79) # connect to finger port >>> tn.write(b'guido\r\n') >>> print(tn.read_all()) Login Name TTY Idle When Where guido Guido van Rossum pts/2 snag.cnri.reston.. >>> Note that read_all() won't read until eof -- it just reads some data -- but it guarantees to read at least one byte unless EOF is hit. It is possible to pass a Telnet object to a selector in order to wait until more data is available. Note that in this case, read_eager() may return b'' even if there was data on the socket, because the protocol negotiation may have eaten the data. This is why EOFError is needed in some cases to distinguish between "no data" and "connection closed" (since the socket also appears ready for reading when it is closed). To do: - option negotiation - timeout should be intrinsic to the connection object instead of an option on one of the read calls only éN)Ú monotonicÚTelnetééÿéþéýéüéûéðéñéòéóéôéõéöé÷éøéùéúééééééééé é é é é éééééééééééééééééé é!é"é#é$é%é&é'é(é)é*é+é,é-é.é/é0é1éŠé‹éŒÚ PollSelectorc@seZdZdZddejfdd„Zdejfdd„Zdd „Zd d „Z d d „Z dd„Z dd„Z dd„Z dd„Zd 0. If extra arguments are present, they are substituted in the message using the standard string formatting operator. rzTelnet(%s,%s):ú )ÚendN)rKÚprintrLrM)rZÚmsgÚargsr[r[r\rjñs  ûz Telnet.msgcCó ||_dS)zhSet the debug level. The higher it is, the more debug output you get (on sys.stdout). N)rK)rZrKr[r[r\Úset_debuglevelÿs zTelnet.set_debuglevelcCs2|j}d|_d|_d|_d|_|r| ¡dSdS)zClose the connection.NTrIr)rOrSrTrUrd)rZrOr[r[r\rds ÿz Telnet.closecCs|jS)z)Return the socket object used internally.)rOrer[r[r\Ú get_socketszTelnet.get_socketcCs |j ¡S)z9Return the fileno() of the socket object used internally.)rOÚfilenorer[r[r\roó z Telnet.filenocCsBt|vr | ttt¡}t d||¡| d|¡|j |¡dS)z­Write a string to the socket, doubling any IAC characters. Can block if the connection is blocked. May raise OSError if the connection is closed. ztelnetlib.Telnet.writezsend %rN)ÚIACÚreplacer_r`rjrOÚsendall)rZÚbufferr[r[r\Úwrites  z Telnet.writecCsnt|ƒ}| ¡|j |¡}|dkr'||}|jd|…}|j|d…|_|S|dur0tƒ|}tƒx}| |tj¡|j s—|  |¡r|t dt|jƒ|ƒ}|  ¡| ¡|j ||¡}|dkr|||}|jd|…}|j|d…|_|WdƒS|durŠ|tƒ}|dkrŠn|j r>Wdƒ|  ¡SWdƒ|  ¡SWdƒ|  ¡S1s®wY|  ¡S)aRead until a given string is encountered or until timeout. When no match is found, return whatever is available instead, possibly the empty string. Raise EOFError if the connection is closed and no cooked data is available. rN)ÚlenÚ process_rawqrRÚfindÚ_timeÚ_TelnetSelectorÚregisterÚ selectorsÚ EVENT_READrSÚselectÚmaxÚ fill_rawqÚread_very_lazy)rZÚmatchrNÚnÚiÚbufÚdeadlineÚselectorr[r[r\Ú read_until&sN   ô ò þñ þÿ ðïzTelnet.read_untilcCs4| ¡|js| ¡| ¡|jr|j}d|_|S)z7Read all data until EOF; block until connection closed.rI)rwrSr€rR©rZr…r[r[r\Úread_allKsþzTelnet.read_allcCs@| ¡|js|js| ¡| ¡|js|jr |j}d|_|S)z™Read at least one byte of cooked data unless EOF is hit. Return b'' if EOF is hit. Block if no data is immediately available. rI)rwrRrSr€r‰r[r[r\Ú read_someUs  þzTelnet.read_somecCs<| ¡|js| ¡r| ¡| ¡|js| ¡s | ¡S)a Read everything that's possible without blocking in I/O (eager). Raise EOFError if connection closed and no cooked data available. Return b'' if no cooked data available otherwise. Don't block unless in the midst of an IAC sequence. )rwrSÚ sock_availr€rrer[r[r\Úread_very_eagerds þzTelnet.read_very_eagercCsH| ¡|js |js | ¡r | ¡| ¡|js |js | ¡s| ¡S)zèRead readily available data. Raise EOFError if connection closed and no cooked data available. Return b'' if no cooked data available otherwise. Don't block unless in the midst of an IAC sequence. )rwrRrSrŒr€rrer[r[r\Ú read_eagerrs þzTelnet.read_eagercCs| ¡| ¡S)aProcess and return data that's already in the queues (lazy). Raise EOFError if connection closed and no data available. Return b'' if no cooked data available otherwise. Don't block unless in the midst of an IAC sequence. )rwrrer[r[r\Ú read_lazy€szTelnet.read_lazycCs(|j}d|_|s|jr|jstdƒ‚|S)zÐReturn any data available in the cooked queue (very lazy). Raise EOFError if connection closed and no data available. Return b'' if no cooked data available otherwise. Don't block. rIztelnet connection closed)rRrSrPÚEOFErrorr‰r[r[r\r‹s zTelnet.read_very_lazycCs|j}d|_|S)aReturn any data available in the SB ... SE queue. Return b'' if no SB ... SE available. Should only be called after seeing a SB or SE command. When a new SB command is found, old unread SB data will be discarded. Don't block. rI)rVr‰r[r[r\Ú read_sb_data˜szTelnet.read_sb_datacCrl)zIProvide a callback function called after each receipt of a telnet option.N)rW)rZÚcallbackr[r[r\Úset_option_negotiation_callback¤rpz&Telnet.set_option_negotiation_callbackcCs<ddg}z÷|jrú| ¡}|js0|tkrq|dkrq|tkr(||j|||j<q|j|7_nÇt|jƒdkr|ttt t fvrG|j|7_qd|_|tkrY||j|||j<nž|t krdd|_d|_ n|t krwd|_|j |d|_ d|d<|jrƒ| |j|t¡nt| dt|ƒ¡njt|jƒdkr÷|jdd…}d|_|}|ttfvrÌ| d|tkr¯dp°d t|ƒ¡|jrÁ| |j||¡n6|j tt |¡n+|t t fvr÷| d|t krÛd pÜd t|ƒ¡|jrí| |j||¡n |j tt|¡|jsWnty d|_d|_Ynw|j|d|_|j |d|_ d S) z Transfer from raw queue to cooked queue. Set self.eof when connection is closed. Don't block unless in the midst of an IAC sequence. rIórrzIAC %d not recognizedrz IAC %s %dÚDOÚDONTÚWILLÚWONTN)rPÚ rawq_getcharrTÚtheNULLrqrUrvr•r–r—r˜ÚSBrVÚSErWrOÚNOOPTrjÚordrsrrR)rZr…ÚcÚcmdÚoptr[r[r\rw¨sr ÿ ÿÉ€8ýzTelnet.process_rawqcCsZ|js | ¡|jr t‚|j|j|jd…}|jd|_|jt|jƒkr+d|_d|_|S)zŽGet next char from raw queue. Block if no data is immediately available. Raise EOFError when connection is closed. rrIr)rPr€rSrrQrv)rZrŸr[r[r\r™ðs zTelnet.rawq_getcharcCsL|jt|jƒkrd|_d|_|j d¡}| d|¡| |_|j||_dS)z¢Fill raw queue from exactly one recv() system call. Block if no data is immediately available. Set self.eof when connection is closed. rIré2zrecv %rN)rQrvrPrOÚrecvrjrSr‰r[r[r\r€s  zTelnet.fill_rawqcCsFtƒ}| |tj¡t| d¡ƒWdƒS1swYdS)z-Test whether data is available on the socket.rN)rzr{r|r}Úboolr~)rZr‡r[r[r\rŒs $þzTelnet.sock_availc Cstjdkr | ¡dStƒk}| |tj¡| tjtj¡ | ¡D]T\}}|j |urYz|  ¡}Wnt yGt dƒYWdƒdSw|rXtj  | d¡¡tj  ¡q#|j tjurwtj ¡ d¡}|srWdƒdS| |¡q#q1s|wYdS)z9Interaction function, emulates a very dumb telnet client.Úwin32NTú(*** Connection closed by remote host ***Úascii)r_ÚplatformÚ mt_interactrzr{r|r}Ústdinr~ÚfileobjrŽrriÚstdoutruÚdecodeÚflushÚreadlineÚencode)rZr‡ÚkeyÚeventsÚtextÚliner[r[r\Úinteracts:    õ  € î €ñüzTelnet.interactcCs<ddl}| |jd¡ tj ¡}|sdS| | d¡¡q )z$Multithreaded version of interact().rNr[rr§)Ú_threadÚstart_new_threadÚlistenerr_rªr¯rur°)rZr¶r´r[r[r\r©3s üzTelnet.mt_interactcCsP z| ¡}WntytdƒYdSw|r"tj | d¡¡ntj ¡q)z>Helper for mt_interact() -- this executes in the other thread.rr¦Nr§)rŽrrir_r¬rur­r®)rZÚdatar[r[r\r¸=s  þ ÷zTelnet.listenerc Cs`d}|dd…}tt|ƒƒ}|D]}t||dƒs(|sddl}| ||¡||<q|dur2tƒ|}tƒc}| |tj ¡|j s‘|  ¡|D]-}||  |j ¡}|rs| ¡} |j d| …} |j | d…|_ ||| fWdƒSqF|durŠ| |¡} |tƒ}| sŠ|dkr‰nq=| ¡|j r@Wdƒn1s›wY| ¡} | s«|j r«t‚dd| fS)a°Read until one from a list of a regular expressions matches. The first argument is a list of regular expressions, either compiled (re.Pattern instances) or uncompiled (strings). The optional second argument is a timeout, in seconds; default is no timeout. Return a tuple of three items: the index in the list of the first regular expression that matches; the re.Match object returned; and the text read up till and including the match. If EOF is read and no text was read, raise EOFError. Otherwise, when nothing matches, return (-1, None, text) where text is the text received so far (may be the empty string if a timeout happened). If a regular expression ends with a greedy match (e.g. '.*') or if more than one expression can match the same input, the results are undeterministic, and may depend on the I/O timing. NÚsearchréÿÿÿÿ)ÚrangervÚhasattrÚreÚcompileryrzr{r|r}rSrwrºrRrhr~r€rr) rZÚlistrNr¾Úindicesr„r†r‡ÚmÚer³Úreadyr[r[r\ÚexpectJsL   €  ö  ï€þ  z Telnet.expectcCs|S©Nr[rer[r[r\Ú __enter__‚szTelnet.__enter__cCs | ¡dSrÆrc)rZÚtypeÚvalueÚ tracebackr[r[r\Ú__exit__…s zTelnet.__exit__rÆ)"Ú__name__Ú __module__Ú __qualname__Ú__doc__raÚ_GLOBAL_DEFAULT_TIMEOUTr]rXrfrjrmrdrnrorurˆrŠr‹rrŽrrr‘r“rwr™r€rŒrµr©r¸rÅrÇrËr[r[r[r\rs@5 ÿ  %    H 8 cCsþd}tjdd…r&tjddkr&|d}tjd=tjdd…r&tjddksd}tjdd…r4tjd}d}tjdd…rXtjd}zt|ƒ}WntyWt |d¡}Ynwtƒ}| |¡|j||dd |  ¡WdƒdS1sxwYdS) zŒTest program for telnetlib. Usage: python telnetlib.py [-d] ... [host [port]] Default host is localhost; default port is 23. rrNz-dÚ localhostrÚtcpgà?)rN) r_ÚargvÚintÚ ValueErrorraÚ getservbynamerrmrXrµ)rKrLrMÚportstrÚtnr[r[r\Útest‰s*þ    ÿ  "ýrÙÚ__main__)ZrÏr_rar|ÚtimerryÚ__all__rJr^Úbytesrqr–r•r˜r—ršrœÚNOPÚDMÚBRKÚIPÚAOÚAYTÚECÚELÚGAr›ÚBINARYÚECHOÚRCPÚSGAÚNAMSÚSTATUSÚTMÚRCTEÚNAOLÚNAOPÚNAOCRDÚNAOHTSÚNAOHTDÚNAOFFDÚNAOVTSÚNAOVTDÚNAOLFDÚXASCIIÚLOGOUTÚBMÚDETÚSUPDUPÚ SUPDUPOUTPUTÚSNDLOCÚTTYPEÚEORÚTUIDÚOUTMRKÚTTYLOCÚ VT3270REGIMEÚX3PADÚNAWSÚTSPEEDÚLFLOWÚLINEMODEÚXDISPLOCÚ OLD_ENVIRONÚAUTHENTICATIONÚENCRYPTÚ NEW_ENVIRONÚTN3270EÚXAUTHÚCHARSETÚRSPÚCOM_PORT_OPTIONÚSUPPRESS_LOCAL_ECHOÚTLSÚKERMITÚSEND_URLÚ FORWARD_XÚ PRAGMA_LOGONÚ SSPI_LOGONÚPRAGMA_HEARTBEATÚEXOPLrr½rHrzÚSelectSelectorrrÙrÌr[r[r[r\Ús¶#                                                                            ÿ