SILENT KILLERPanel

Current Path: > > opt > alt > python37 > lib64 > python3.7 > > idlelib > __pycache__


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/alt/python37/lib64/python3.7//idlelib/__pycache__

NameTypeSizeLast ModifiedActions
__init__.cpython-37.opt-1.pyc File 513 bytes April 17 2024 17:36:09.
__init__.cpython-37.opt-2.pyc File 151 bytes April 17 2024 17:35:53.
__init__.cpython-37.pyc File 513 bytes April 17 2024 17:36:15.
__main__.cpython-37.opt-1.pyc File 274 bytes April 17 2024 17:36:09.
__main__.cpython-37.opt-2.pyc File 203 bytes April 17 2024 17:35:53.
__main__.cpython-37.pyc File 274 bytes April 17 2024 17:36:15.
autocomplete.cpython-37.opt-1.pyc File 6796 bytes April 17 2024 17:36:09.
autocomplete.cpython-37.opt-2.pyc File 5398 bytes April 17 2024 17:35:53.
autocomplete.cpython-37.pyc File 6796 bytes April 17 2024 17:36:15.
autocomplete_w.cpython-37.opt-1.pyc File 11032 bytes April 17 2024 17:36:09.
autocomplete_w.cpython-37.opt-2.pyc File 10274 bytes April 17 2024 17:35:53.
autocomplete_w.cpython-37.pyc File 11090 bytes April 17 2024 17:36:15.
autoexpand.cpython-37.opt-1.pyc File 2826 bytes April 17 2024 17:36:09.
autoexpand.cpython-37.opt-2.pyc File 2076 bytes April 17 2024 17:35:53.
autoexpand.cpython-37.pyc File 2826 bytes April 17 2024 17:36:15.
browser.cpython-37.opt-1.pyc File 9490 bytes April 17 2024 17:36:09.
browser.cpython-37.opt-2.pyc File 6823 bytes April 17 2024 17:35:53.
browser.cpython-37.pyc File 9490 bytes April 17 2024 17:36:15.
calltip.cpython-37.opt-1.pyc File 5572 bytes April 17 2024 17:36:09.
calltip.cpython-37.opt-2.pyc File 3951 bytes April 17 2024 17:35:53.
calltip.cpython-37.pyc File 5572 bytes April 17 2024 17:36:15.
calltip_w.cpython-37.opt-1.pyc File 6168 bytes April 17 2024 17:36:09.
calltip_w.cpython-37.opt-2.pyc File 5235 bytes April 17 2024 17:35:53.
calltip_w.cpython-37.pyc File 6168 bytes April 17 2024 17:36:15.
codecontext.cpython-37.opt-1.pyc File 8695 bytes April 17 2024 17:36:09.
codecontext.cpython-37.opt-2.pyc File 5700 bytes April 17 2024 17:35:53.
codecontext.cpython-37.pyc File 8730 bytes April 17 2024 17:36:15.
colorizer.cpython-37.opt-1.pyc File 10266 bytes April 17 2024 17:36:09.
colorizer.cpython-37.opt-2.pyc File 8172 bytes April 17 2024 17:35:53.
colorizer.cpython-37.pyc File 10266 bytes April 17 2024 17:36:15.
config.cpython-37.opt-1.pyc File 29872 bytes April 17 2024 17:36:09.
config.cpython-37.opt-2.pyc File 19952 bytes April 17 2024 17:35:53.
config.cpython-37.pyc File 29872 bytes April 17 2024 17:36:15.
config_key.cpython-37.opt-1.pyc File 11339 bytes April 17 2024 17:36:09.
config_key.cpython-37.opt-2.pyc File 9919 bytes April 17 2024 17:35:53.
config_key.cpython-37.pyc File 11339 bytes April 17 2024 17:36:15.
configdialog.cpython-37.opt-1.pyc File 78613 bytes April 17 2024 17:36:09.
configdialog.cpython-37.opt-2.pyc File 48456 bytes April 17 2024 17:35:53.
configdialog.cpython-37.pyc File 78613 bytes April 17 2024 17:36:15.
debugger.cpython-37.opt-1.pyc File 14219 bytes April 17 2024 17:36:09.
debugger.cpython-37.opt-2.pyc File 14068 bytes April 17 2024 17:35:53.
debugger.cpython-37.pyc File 14219 bytes April 17 2024 17:36:15.
debugger_r.cpython-37.opt-1.pyc File 13771 bytes April 17 2024 17:36:09.
debugger_r.cpython-37.opt-2.pyc File 11380 bytes April 17 2024 17:35:53.
debugger_r.cpython-37.pyc File 13897 bytes April 17 2024 17:36:15.
debugobj.cpython-37.opt-1.pyc File 5177 bytes April 17 2024 17:36:09.
debugobj.cpython-37.opt-2.pyc File 5177 bytes April 17 2024 17:35:53.
debugobj.cpython-37.pyc File 5177 bytes April 17 2024 17:36:15.
debugobj_r.cpython-37.opt-1.pyc File 2018 bytes April 17 2024 17:36:09.
debugobj_r.cpython-37.opt-2.pyc File 2018 bytes April 17 2024 17:35:53.
debugobj_r.cpython-37.pyc File 2018 bytes April 17 2024 17:36:15.
delegator.cpython-37.opt-1.pyc File 1280 bytes April 17 2024 17:36:09.
delegator.cpython-37.opt-2.pyc File 1180 bytes April 17 2024 17:35:53.
delegator.cpython-37.pyc File 1280 bytes April 17 2024 17:36:15.
dynoption.cpython-37.opt-1.pyc File 2291 bytes April 17 2024 17:36:09.
dynoption.cpython-37.opt-2.pyc File 1911 bytes April 17 2024 17:35:53.
dynoption.cpython-37.pyc File 2291 bytes April 17 2024 17:36:15.
editor.cpython-37.opt-1.pyc File 46605 bytes April 17 2024 17:36:09.
editor.cpython-37.opt-2.pyc File 44705 bytes April 17 2024 17:35:53.
editor.cpython-37.pyc File 46692 bytes April 17 2024 17:36:15.
filelist.cpython-37.opt-1.pyc File 3376 bytes April 17 2024 17:36:09.
filelist.cpython-37.opt-2.pyc File 3343 bytes April 17 2024 17:35:53.
filelist.cpython-37.pyc File 3402 bytes April 17 2024 17:36:15.
format.cpython-37.opt-1.pyc File 13440 bytes April 17 2024 17:36:09.
format.cpython-37.opt-2.pyc File 9717 bytes April 17 2024 17:35:53.
format.cpython-37.pyc File 13440 bytes April 17 2024 17:36:15.
grep.cpython-37.opt-1.pyc File 7791 bytes April 17 2024 17:36:09.
grep.cpython-37.opt-2.pyc File 5096 bytes April 17 2024 17:35:53.
grep.cpython-37.pyc File 7791 bytes April 17 2024 17:36:15.
help.cpython-37.opt-1.pyc File 10376 bytes April 17 2024 17:36:09.
help.cpython-37.opt-2.pyc File 7607 bytes April 17 2024 17:35:53.
help.cpython-37.pyc File 10418 bytes April 17 2024 17:36:15.
help_about.cpython-37.opt-1.pyc File 7337 bytes April 17 2024 17:36:09.
help_about.cpython-37.opt-2.pyc File 6215 bytes April 17 2024 17:35:53.
help_about.cpython-37.pyc File 7337 bytes April 17 2024 17:36:15.
history.cpython-37.opt-1.pyc File 3394 bytes April 17 2024 17:36:09.
history.cpython-37.opt-2.pyc File 2169 bytes April 17 2024 17:35:53.
history.cpython-37.pyc File 3394 bytes April 17 2024 17:36:15.
hyperparser.cpython-37.opt-1.pyc File 6749 bytes April 17 2024 17:36:09.
hyperparser.cpython-37.opt-2.pyc File 5442 bytes April 17 2024 17:35:53.
hyperparser.cpython-37.pyc File 6749 bytes April 17 2024 17:36:15.
idle.cpython-37.opt-1.pyc File 339 bytes April 17 2024 17:36:09.
idle.cpython-37.opt-2.pyc File 339 bytes April 17 2024 17:35:53.
idle.cpython-37.pyc File 339 bytes April 17 2024 17:36:15.
iomenu.cpython-37.opt-1.pyc File 13780 bytes April 17 2024 17:36:09.
iomenu.cpython-37.opt-2.pyc File 13312 bytes April 17 2024 17:35:53.
iomenu.cpython-37.pyc File 13780 bytes April 17 2024 17:36:15.
macosx.cpython-37.opt-1.pyc File 7594 bytes April 17 2024 17:36:09.
macosx.cpython-37.opt-2.pyc File 5412 bytes April 17 2024 17:35:53.
macosx.cpython-37.pyc File 7594 bytes April 17 2024 17:36:15.
mainmenu.cpython-37.opt-1.pyc File 3461 bytes April 17 2024 17:36:09.
mainmenu.cpython-37.opt-2.pyc File 2990 bytes April 17 2024 17:35:53.
mainmenu.cpython-37.pyc File 3461 bytes April 17 2024 17:36:15.
multicall.cpython-37.opt-1.pyc File 14937 bytes April 17 2024 17:36:09.
multicall.cpython-37.opt-2.pyc File 12572 bytes April 17 2024 17:35:53.
multicall.cpython-37.pyc File 14994 bytes April 17 2024 17:36:15.
outwin.cpython-37.opt-1.pyc File 6062 bytes April 17 2024 17:36:09.
outwin.cpython-37.opt-2.pyc File 4378 bytes April 17 2024 17:35:53.
outwin.cpython-37.pyc File 6062 bytes April 17 2024 17:36:15.
parenmatch.cpython-37.opt-1.pyc File 6334 bytes April 17 2024 17:36:09.
parenmatch.cpython-37.opt-2.pyc File 4788 bytes April 17 2024 17:35:53.
parenmatch.cpython-37.pyc File 6334 bytes April 17 2024 17:36:15.
pathbrowser.cpython-37.opt-1.pyc File 3743 bytes April 17 2024 17:36:09.
pathbrowser.cpython-37.opt-2.pyc File 3602 bytes April 17 2024 17:35:53.
pathbrowser.cpython-37.pyc File 3743 bytes April 17 2024 17:36:15.
percolator.cpython-37.opt-1.pyc File 3516 bytes April 17 2024 17:36:09.
percolator.cpython-37.opt-2.pyc File 3516 bytes April 17 2024 17:35:53.
percolator.cpython-37.pyc File 3654 bytes April 17 2024 17:36:15.
pyparse.cpython-37.opt-1.pyc File 11639 bytes April 17 2024 17:36:09.
pyparse.cpython-37.opt-2.pyc File 8060 bytes April 17 2024 17:35:53.
pyparse.cpython-37.pyc File 11988 bytes April 17 2024 17:36:15.
pyshell.cpython-37.opt-1.pyc File 42251 bytes April 17 2024 17:36:09.
pyshell.cpython-37.opt-2.pyc File 39523 bytes April 17 2024 17:35:53.
pyshell.cpython-37.pyc File 42381 bytes April 17 2024 17:36:15.
query.cpython-37.opt-1.pyc File 12815 bytes April 17 2024 17:36:09.
query.cpython-37.opt-2.pyc File 10093 bytes April 17 2024 17:35:53.
query.cpython-37.pyc File 12815 bytes April 17 2024 17:36:15.
redirector.cpython-37.opt-1.pyc File 6763 bytes April 17 2024 17:36:09.
redirector.cpython-37.opt-2.pyc File 3331 bytes April 17 2024 17:35:53.
redirector.cpython-37.pyc File 6763 bytes April 17 2024 17:36:15.
replace.cpython-37.opt-1.pyc File 9358 bytes April 17 2024 17:36:09.
replace.cpython-37.opt-2.pyc File 6516 bytes April 17 2024 17:35:53.
replace.cpython-37.pyc File 9358 bytes April 17 2024 17:36:15.
rpc.cpython-37.opt-1.pyc File 19604 bytes April 17 2024 17:36:09.
rpc.cpython-37.opt-2.pyc File 16058 bytes April 17 2024 17:35:53.
rpc.cpython-37.pyc File 19691 bytes April 17 2024 17:36:15.
run.cpython-37.opt-1.pyc File 17677 bytes April 17 2024 17:36:09.
run.cpython-37.opt-2.pyc File 15202 bytes April 17 2024 17:35:53.
run.cpython-37.pyc File 17725 bytes April 17 2024 17:36:15.
runscript.cpython-37.opt-1.pyc File 7070 bytes April 17 2024 17:36:09.
runscript.cpython-37.opt-2.pyc File 5836 bytes April 17 2024 17:35:53.
runscript.cpython-37.pyc File 7070 bytes April 17 2024 17:36:15.
scrolledlist.cpython-37.opt-1.pyc File 5403 bytes April 17 2024 17:36:09.
scrolledlist.cpython-37.opt-2.pyc File 5403 bytes April 17 2024 17:35:53.
scrolledlist.cpython-37.pyc File 5403 bytes April 17 2024 17:36:15.
search.cpython-37.opt-1.pyc File 5931 bytes April 17 2024 17:36:09.
search.cpython-37.opt-2.pyc File 3439 bytes April 17 2024 17:35:53.
search.cpython-37.pyc File 5931 bytes April 17 2024 17:36:15.
searchbase.cpython-37.opt-1.pyc File 8037 bytes April 17 2024 17:36:09.
searchbase.cpython-37.opt-2.pyc File 5277 bytes April 17 2024 17:35:53.
searchbase.cpython-37.pyc File 8037 bytes April 17 2024 17:36:15.
searchengine.cpython-37.opt-1.pyc File 6841 bytes April 17 2024 17:36:09.
searchengine.cpython-37.opt-2.pyc File 5191 bytes April 17 2024 17:35:53.
searchengine.cpython-37.pyc File 6841 bytes April 17 2024 17:36:15.
sidebar.cpython-37.opt-1.pyc File 10987 bytes April 17 2024 17:36:09.
sidebar.cpython-37.opt-2.pyc File 9539 bytes April 17 2024 17:35:53.
sidebar.cpython-37.pyc File 10987 bytes April 17 2024 17:36:15.
squeezer.cpython-37.opt-1.pyc File 9520 bytes April 17 2024 17:36:09.
squeezer.cpython-37.opt-2.pyc File 6333 bytes April 17 2024 17:35:53.
squeezer.cpython-37.pyc File 9557 bytes April 17 2024 17:36:15.
stackviewer.cpython-37.opt-1.pyc File 5054 bytes April 17 2024 17:36:09.
stackviewer.cpython-37.opt-2.pyc File 5054 bytes April 17 2024 17:35:53.
stackviewer.cpython-37.pyc File 5054 bytes April 17 2024 17:36:15.
statusbar.cpython-37.opt-1.pyc File 1949 bytes April 17 2024 17:36:09.
statusbar.cpython-37.opt-2.pyc File 1949 bytes April 17 2024 17:35:53.
statusbar.cpython-37.pyc File 1949 bytes April 17 2024 17:36:15.
textview.cpython-37.opt-1.pyc File 7065 bytes April 17 2024 17:36:09.
textview.cpython-37.opt-2.pyc File 4909 bytes April 17 2024 17:35:53.
textview.cpython-37.pyc File 7065 bytes April 17 2024 17:36:15.
tooltip.cpython-37.opt-1.pyc File 6570 bytes April 17 2024 17:36:09.
tooltip.cpython-37.opt-2.pyc File 4948 bytes April 17 2024 17:35:53.
tooltip.cpython-37.pyc File 6570 bytes April 17 2024 17:36:15.
tree.cpython-37.opt-1.pyc File 15696 bytes April 17 2024 17:36:09.
tree.cpython-37.opt-2.pyc File 14352 bytes April 17 2024 17:35:53.
tree.cpython-37.pyc File 15696 bytes April 17 2024 17:36:15.
undo.cpython-37.opt-1.pyc File 10769 bytes April 17 2024 17:36:09.
undo.cpython-37.opt-2.pyc File 10769 bytes April 17 2024 17:35:53.
undo.cpython-37.pyc File 10769 bytes April 17 2024 17:36:15.
window.cpython-37.opt-1.pyc File 3195 bytes April 17 2024 17:36:09.
window.cpython-37.opt-2.pyc File 3195 bytes April 17 2024 17:35:53.
window.cpython-37.pyc File 3195 bytes April 17 2024 17:36:15.
zoomheight.cpython-37.opt-1.pyc File 2798 bytes April 17 2024 17:36:09.
zoomheight.cpython-37.opt-2.pyc File 2749 bytes April 17 2024 17:35:53.
zoomheight.cpython-37.pyc File 2798 bytes April 17 2024 17:36:15.
zzdummy.cpython-37.opt-1.pyc File 1210 bytes April 17 2024 17:36:09.
zzdummy.cpython-37.opt-2.pyc File 1142 bytes April 17 2024 17:35:53.
zzdummy.cpython-37.pyc File 1210 bytes April 17 2024 17:36:15.

Reading File: //opt/alt/python37/lib64/python3.7//idlelib/__pycache__/rpc.cpython-37.pyc

B

� f�R�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZdd�Zdd�Zd*dd�ZGd	d
�d
ej�ZdZdZGd
d�de
j�ZiZe�d�Ze�d�ZGdd�de�ZGdd�de�Zdd�Z Gdd�de�Z!Gdd�de
j"e�Z#Gdd�de�Z$Gdd�de�Z%dd�Z&dd �Z'Gd!d"�d"e�Z(d#d$�Z)e*d%k�r�dd&l+m,Z,e,d'd(d)�dS)+aRPC Implementation, originally written for the Python Idle IDE

For security reasons, GvR requested that Idle's Python execution server process
connect to the Idle process, which listens for the connection.  Since Idle has
only one client per server, this was not a limitation.

   +---------------------------------+ +-------------+
   | socketserver.BaseRequestHandler | | SocketIO    |
   +---------------------------------+ +-------------+
                   ^                   | register()  |
                   |                   | unregister()|
                   |                   +-------------+
                   |                      ^  ^
                   |                      |  |
                   | + -------------------+  |
                   | |                       |
   +-------------------------+        +-----------------+
   | RPCHandler              |        | RPCClient       |
   | [attribute of RPCServer]|        |                 |
   +-------------------------+        +-----------------+

The RPCServer handler class is expected to provide register/unregister methods.
RPCHandler inherits the mix-in class SocketIO, which provides these methods.

See the Idle run.main() docstring for further information on how this was
accomplished in Idle.

�NcCst�|�}t|tj�st�|S)z*Return code object from marshal string ms.)�marshal�loads�
isinstance�types�CodeType�AssertionError)�ms�co�r
�0/opt/alt/python37/lib64/python3.7/idlelib/rpc.py�
unpickle_code-s
rcCs$t|tj�st�t�|�}t|ffS)zBReturn unpickle function and tuple with marshalled co code object.)rrrrr�dumpsr)r	rr
r
r�pickle_code3s
rcCs$t��}t||�}|�|�|��S)z.Return pickled (or marshalled) string for obj.)�io�BytesIO�CodePickler�dump�getvalue)�objZprotocol�f�pr
r
rr
9s

r
c@s"eZdZejeiZe�ej�dS)rN)	�__name__�
__module__�__qualname__rrr�dispatch_table�update�copyregr
r
r
rrBs
ri z	127.0.0.1c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	RPCServerNcCs |dkrt}tj�|||�dS)N)�
RPCHandler�socketserver�	TCPServer�__init__)�self�addrZhandlerclassr
r
rr!LszRPCServer.__init__cCsdS)z@Override TCPServer method, no bind() phase for connecting entityNr
)r"r
r
r�server_bindQszRPCServer.server_bindcCs|j�|j�dS)z�Override TCPServer method, connect() instead of listen()

        Due to the reversed connection, self.server_address is actually the
        address of the Idle Client to which we are connecting.

        N)�socketZconnect�server_address)r"r
r
r�server_activateUszRPCServer.server_activatecCs|j|jfS)z:Override TCPServer method, return already connected socket)r%r&)r"r
r
r�get_request^szRPCServer.get_requestcCs�y�Wn�tk
r�Yn�tj}td|d�td|d�tdt��j|d�td||d�tdt|�|d�tj	|d�td|d�td|d�t
�d	�YnXd
S)z�Override TCPServer method

        Error message goes to __stderr__.  No error message if exiting
        normally or socket raised EOF.  Other exceptions not handled in
        server code will cause os._exit.

        z)
----------------------------------------)�filezUnhandled server exception!z
Thread: %szClient Address: z	Request: z#
*** Unrecoverable, server exiting!z(----------------------------------------rN)�
SystemExit�sys�
__stderr__�print�	threading�current_thread�name�repr�	traceback�	print_exc�os�_exit)r"�requestZclient_addressZerfr
r
r�handle_errorbszRPCServer.handle_error)N)rrrr!r$r'r(r7r
r
r
rrJs

	rc@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+Zd,ZdZd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!dS)<�SocketIOrNcCs@t��|_|dk	r||_||_|dkr*t}||_i|_i|_dS)N)	r.r/�
sockthread�	debugging�sock�objecttable�objtable�	responses�cvars)r"r;r=r:r
r
rr!�s
zSocketIO.__init__cCs |j}d|_|dk	r|��dS)N)r;�close)r"r;r
r
rr@�szSocketIO.closecCst�d�dS)z!override for specific exit actionrN)r4r5)r"r
r
r�exithook�szSocketIO.exithookcGsR|js
dS|jdtt��j�}x|D]}|dt|�}q(Wt|tjd�dS)N� )r))	r:�location�strr.r/r0r-r+r,)r"�args�s�ar
r
r�debug�s
zSocketIO.debugcCs||j|<dS)N)r=)r"�oid�objectr
r
r�register�szSocketIO.registercCs&y|j|=Wntk
r YnXdS)N)r=�KeyError)r"rIr
r
r�
unregister�szSocketIO.unregisterc
Cs�|�d|�y|\}\}}}}Wntk
r4dSX||jkrNdd|ffS|j|}|dkrvi}	t||	�d|	fS|dkr�i}
t||
�d|
fSt||�s�dd|ffSt||�}y^|d	kr�|||�}t|t�r�t	|�}d|fS|d
k�rt
�||||ff�dSdd|fSWn�tk
�r,�Yn�t
k
�rB�Ynptk
�rX�YnZtk
�r~}
zd
|
fSd}
~
XYn4d}t||||ftjd�tjtjd�dSdS)Nz
localcall:)�ERRORzBad request formatrNzUnknown object id: %r�__methods__�OK�__attributes__zUnsupported method name: %r�CALL�QUEUE)�QUEUEDNzUnsupported message type: %s�CALLEXCzU*** Internal Error: rpc.py:SocketIO.localcall()

 Object: %s 
 Method: %s 
 Args: %s
)r))�	EXCEPTIONN)rH�	TypeErrorr=�_getmethods�_getattributes�hasattr�getattrr�RemoteObject�	remoteref�
request_queueZputr*�KeyboardInterrupt�OSError�	Exceptionr-r+r,r2r3)r"�seqr6�howrI�
methodnamerE�kwargsr�methods�
attributes�methodZretZex�msgr
r
r�	localcall�sT








zSocketIO.localcallcCs(|�d||�|�||||�}|�|�S)Nzremotecall:asynccall: )rH�	asynccall�asyncreturn)r"rIrdrErerbr
r
r�
remotecall�szSocketIO.remotecallcCs(|�d||�|�||||�}|�|�S)Nzremotequeue:asyncqueue: )rH�
asyncqueuerl)r"rIrdrErerbr
r
r�remotequeue�szSocketIO.remotequeuecCs`d||||ff}|��}t��|jkr8t��}||j|<|�d|||||�|�||f�|S)NrRz
asynccall:%d:)�newseqr.r/r9�	Conditionr?rH�
putmessage)r"rIrdrErer6rb�cvarr
r
rrk�s
zSocketIO.asynccallcCs`d||||ff}|��}t��|jkr8t��}||j|<|�d|||||�|�||f�|S)NrSzasyncqueue:%d:)rpr.r/r9rqr?rHrr)r"rIrdrErer6rbrsr
r
rrn�s
zSocketIO.asyncqueuecCs6|�d|�|j|dd�}|�d||�|�|�S)Nz#asyncreturn:%d:call getresponse(): g�������?)�waitzasyncreturn:%d:response: )rH�getresponse�decoderesponse)r"rb�responser
r
rrl�szSocketIO.asyncreturncCs�|\}}|dkr|S|dkr dS|dkr6|�d�dS|dkrT|�d�|��dS|dkrp|�d|�t|��|d	kr�|�d
|�|�t||��dS)NrPrTrVzdecoderesponse: EXCEPTION�EOFzdecoderesponse: EOFrNzdecoderesponse: Internal ERROR:rUzdecoderesponse: Call Exception:)rH�decode_interrupthook�RuntimeError�SystemError)r"rwrc�whatr
r
rrv�s&

zSocketIO.decoderesponsecCst�dS)�N)�EOFError)r"r
r
rryszSocketIO.decode_interrupthookcCs6y|jddd�Wntk
r0|�d�dSXdS)z�Listen on socket until I/O not ready or EOF

        pollresponse() will loop looking for seq number None, which
        never comes, and exit on EOFError.

        Ng�������?)�myseqrtzmainloop:return)rur~rH)r"r
r
r�mainloops

zSocketIO.mainloopcCs6|�||�}|dk	r2|\}}|dkr2||�|�f}|S)NrP)�_getresponse�_proxify)r"rrtrwrcr|r
r
rru#szSocketIO.getresponsecCs4t|t�rt||j�St|t�r0tt|j|��S|S)N)r�RemoteProxy�RPCProxyrI�list�mapr�)r"rr
r
rr�+s


zSocketIO._proxifycCs�|�d|�t��|jkr:x�|�||�}|dk	r|SqWnb|j|}|��x||jkrb|��qNW|j|}|�d||f�|j|=|j|=|�	�|SdS)Nz_getresponse:myseq:z-_getresponse:%s: thread woke up: response: %s)
rHr.r/r9�pollresponser?�acquirer>rt�release)r"rrtrwrsr
r
rr�3s"


zSocketIO._getresponsecCs|jd|_}|S)N�)�nextseq)r"rbr
r
rrpIszSocketIO.newseqc	Cs�|�d|d�yt|�}Wn,tjk
rJtdt|�tjd��YnXt�	dt
|��|}xnt
|�dkr�y0t�g|jgg�\}}}|j�
|dt��}Wn ttfk
r�td��YnX||d�}qbWdS)Nzputmessage:%d:rzCannot pickle:)r)z<izsocket no longer exists)rHr
�pickleZ
PicklingErrorr-r1r+r,�structZpack�len�selectr;�send�BUFSIZE�AttributeErrorrWr`)r"�messagerF�r�w�x�nr
r
rrrMszSocketIO.putmessage��cCs�|��t|j�|jkr�t�|j��ggg|�\}}}t|�dkrFdSy|j�t�}Wnt	k
rnt
�YnXt|�dkr�t
�|j|7_|��|��S)Nr)�_stage0r��buff�bufneedr�r;�filenoZrecvr�r`r~�_stage1)r"rtr�r�r�rFr
r
r�
pollpacketas
zSocketIO.pollpacketcCsR|jdkrNt|j�dkrN|jdd�}|jdd�|_t�d|�d|_d|_dS)Nrr�z<i�)�bufstater�r�r�Zunpackr�)r"rFr
r
rr�qs
zSocketIO._stage0cCsP|jdkrLt|j�|jkrL|jd|j�}|j|jd�|_d|_d|_|SdS)Nr�r�r)r�r�r�r�)r"�packetr
r
rr�xszSocketIO._stage1cCs�|�|�}|dkrdSyt�|�}WnVtjk
rztdtjd�tdt|�tjd�tj	tjd�tdtjd��YnX|S)Nz-----------------------)r)zcannot unpickle packet:)
r�r�rZUnpicklingErrorr-r+r,r1r2�print_stack)r"rtr�r�r
r
r�pollmessage�s
zSocketIO.pollmessagec
Cs`�xXyt�d�}Wntjk
r(Yn X|\}}|d|ff}|�|�y|�|�}|dkr`dSWn.tk
r~|��dStk
r�dSX|\}}|d}|�	d||f�|dk�r|�	d|�|�
||�}|�	d||f�|dk�r|�||f�q|d	krqq||k�r|S|j�|d�}	|	dk	r|	��||j
|<|	��|	��qqWdS)
aRHandle messages received on the socket.

        Some messages received may be asynchronous 'call' or 'queue' requests,
        and some may be responses for other threads.

        'call' requests are passed to self.localcall() with the expectation of
        immediate execution, during which time the socket is not serviced.

        'queue' requests are used for tasks (which may block or hang) to be
        processed in a different thread.  These requests are fed into
        request_queue by self.localcall().  Responses to queued requests are
        taken from response_queue and sent across the link with the associated
        sequence numbers.  Messages in the queues are (sequence_number,
        request/response) tuples and code using this module removing messages
        from the request_queue is responsible for returning the correct
        sequence number in the response_queue.

        pollresponse() will loop until a response message with the myseq
        sequence number is received, and will save other responses in
        self.responses and notify the owning thread.

        rrPNzpollresponse:%d:myseq:%s)rRrSzpollresponse:%d:localcall:call:z%pollresponse:%d:localcall:response:%srRrS)�response_queue�get�queueZEmptyrrr�r~�
handle_EOFr�rHrjr?r�r>�notifyr�)
r"rrtZqmsgrbrwr�Zresqrc�cvr
r
rr��sL





zSocketIO.pollresponsecCsZ|��|�d�x:|jD]0}|j|}|��d|j|<|��|��qW|��dS)z+action taken upon link being closed by peerr�)rxNN)�EOFhookrHr?r�r>r�r�rA)r"�keyr�r
r
rr��s


zSocketIO.handle_EOFcCsdS)zBClasses using rpc client/server can override to augment EOF actionNr
)r"r
r
rr��szSocketIO.EOFhook)NN)"rrrr�r!r@rArHrKrMrjrmrorkrnrlrvryr�rur�r�rprrr�r�r�r�r�r�r�r�r�r�r
r
r
rr8�s>
.


I
r8c@seZdZdS)r\N)rrrr
r
r
rr\�sr\cCst|�}|t|<t|�S)N)�idr<r�)rrIr
r
rr]�sr]c@seZdZdd�ZdS)r�cCs
||_dS)N)rI)r"rIr
r
rr!�szRemoteProxy.__init__N)rrrr!r
r
r
rr��sr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rFz#ScCs(||_t�||�tj�||||�dS)N)Zcurrent_handlerr8r!r�BaseRequestHandler)r"r;r#Zsvrr
r
rr!szRPCHandler.__init__cCs|��dS)z(handle() method required by socketserverN)r�)r"r
r
r�handleszRPCHandler.handlecCs
t||�S)N)r�)r"rIr
r
r�get_remote_proxy	szRPCHandler.get_remote_proxyN)rrrr:rCr!r�r�r
r
r
rr�s
rc@s:eZdZdZdZdZejejfdd�Z	dd�Z
dd	�Zd
S)�	RPCClientFz#Cr�cCs*t�||�|_|j�|�|j�d�dS)Nr�)r%�listening_sockZbindZlisten)r"�addressZfamily�typer
r
rr!szRPCClient.__init__cCsV|j��\}}|jr$td|tjd�|dtkr>t�||�ntd|tjd�t	�dS)Nz****** Connection request from )r)rz** Invalid host: )
r��acceptr:r-r+r,�	LOCALHOSTr8r!r`)r"Zworking_sockr�r
r
rr�szRPCClient.acceptcCs
t||�S)N)r�)r"rIr
r
rr�#szRPCClient.get_remote_proxyN)rrrr:rCr�r%ZAF_INETZSOCK_STREAMr!r�r�r
r
r
rr�
s
r�c@s4eZdZdZdZdd�Zdd�Zdd�Zdd	�ZdS)
r�NcCs||_||_dS)N)�sockiorI)r"r�rIr
r
rr!,szRPCProxy.__init__cCsp|jdkr|��|j�|�r.t|j|j|�S|jdkr@|��||jkrd|j�|jd|fi�}|St	|��dS)N�__getattribute__)
�_RPCProxy__methods�_RPCProxy__getmethodsr��MethodProxyr�rI�_RPCProxy__attributes�_RPCProxy__getattributesrmr�)r"r0�valuer
r
r�__getattr__0s



zRPCProxy.__getattr__cCs|j�|jddi�|_dS)NrQr
)r�rmrIr�)r"r
r
rZ__getattributes>s
zRPCProxy.__getattributescCs|j�|jddi�|_dS)NrOr
)r�rmrIr�)r"r
r
rZ__getmethodsBs
zRPCProxy.__getmethods)	rrrr�r�r!r�r�r�r
r
r
rr�'sr�cCsTx*t|�D]}t||�}t|�r
d||<q
Wt|t�rPx|jD]}t||�q>WdS)Nr�)�dirr[�callablerr��	__bases__rX)rrfr0�attr�superr
r
rrXFs

rXcCs0x*t|�D]}t||�}t|�s
d||<q
WdS)Nr�)r�r[r�)rrgr0r�r
r
rrYQs
rYc@seZdZdd�Zdd�ZdS)r�cCs||_||_||_dS)N)r�rIr0)r"r�rIr0r
r
rr!ZszMethodProxy.__init__cOs|j�|j|j||�}|S)N)r�rmrIr0)r"rErer�r
r
r�__call___szMethodProxy.__call__N)rrrr!r�r
r
r
rr�Xsr�cCs~|dkrdSdt_t|�}ytj�|�Wn<tk
rfd}|�|d�}|�|d�}tj�|�YnXtj�d�|t_dS)z9Override standard display hook to use non-locale encodingN�ascii�backslashreplace�strict�
)	�builtins�_r1r+�stdout�write�UnicodeEncodeError�encode�decode)r��text�encoding�bytesr
r
r�displayhookgsr��__main__)�mainzidlelib.idle_test.test_rpcr�)�	verbosity)N)-�__doc__r�rrrr4r�r�r�r%rr�r+r.r2rrrr
ZPicklerrr�r�r rr<ZQueuer^r�rJr8r\r]r�r�rr�r�rXrYr�r�rZunittestr�r
r
r
r�<module>sR
	2

k


SILENT KILLER Tool