ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/run.cpython-36.opt-2.pyc

3

��2axC�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZddlmZddlmZddlmZddlmZddlZx"d8D]Zee
e�ejde=q�WdZd9dd�Zd:dd�Zdadd�Zed�e
j�Zefdd�Zdada da!d;dd�Z"dd�Z#d d!�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*d+�Z)Gd,d-�d-ej*�Z+Gd.d/�d/ej,�Z-Gd0d1�d1e-�Z.Gd2d3�d3e-�Z/Gd4d5�d5ej0�Z1Gd6d7�d7e2�Z3ed�dS)<�N)�autocomplete)�calltip)�
debugger_r)�
debugobj_r)�iomenu)�rpc)�stackviewer�simpledialog�
messagebox�font�dialog�
filedialog�commondialog�ttkztkinter.z	127.0.0.1cCsVd}|d||f7}|dkr(tj||�}|j�}|r@|d|7}|d|j|f7}|S)Nz!
Warning (from warnings module):
z  File "%s", line %s
z    %s
z%s: %s
)�	linecache�getline�strip�__name__)�message�category�filename�lineno�line�s�r�(/opt/alt/python36/lib64/python3.6/run.py�idle_formatwarningsrc
CsB|dkrtj}y|jt|||||��Wntk
r<YnXdS)N)�sys�stderr�writer�OSError)rrrr�filerrrr�idle_showwarning_subproc,sr"cCs0|rtdkr,tjatt_ntdk	r,tt_dadS)N)�_warnings_showwarning�warnings�showwarningr")Zcapturerrr�capture_warnings<sr&TcCs|jd�dS)N�update)�eval)�tclrrr�handle_tk_eventsLsr*FcCs�|ayttjd�}Wntdtjd�dStd�dgtjdd�<tjt	dt
|ffd�}d|_|j��x0y�t
r�y
t�Wntk
r�wpYnXytjjddd	�}Wntjk
r�d}YnX|r�|\}\}}}|||�}tjj||f�nt�Wqptk
�r t�rda
wpYqptk
�r>td
��Yqptj�\}	}
}yt�tjj|df�Wn&tj|	|
|tjd�t�YnXwpYqpXqpWdS)N�z/IDLE Subprocess: no IP port passed in sys.argv.)r!T�Z
SockThread)�target�name�argsg�������?)�blockZtimeoutF���)�no_exitfunc�intr�argv�print�
__stderr__r&�	threadingZThread�
manage_socket�	LOCALHOSTZdaemon�start�exit_now�exit�KeyboardInterruptrZ
request_queue�get�queueZEmptyZresponse_queueZputr*�quitting�
SystemExit�exc_info�print_exception�	traceback)Zdel_exitfuncZportZ
sockthread�request�seq�methodr/�kwargs�ret�type�value�tbrrr�mainZs\




rMcCs�x�td�D]b}tj|�yt|t�}PWq
tk
rj}z&td|jddtj	d�|}WYdd}~Xq
Xq
Wtdtj	d�t
||�dadS|j�dS)N�zIDLE Subprocess: OSError: r+z, retrying....)r!z8IDLE Subprocess: Connection to IDLE GUI failed, exiting.T)
�range�time�sleep�MyRPCServer�	MyHandlerr r5r/rr6�show_socket_errorr;Zhandle_request)�address�iZserver�errZsocket_errorrrrr8�s



r8c	Cspddl}ddlm}|j�}t|�|j�d|d�d|d�d|j�d|j�d�	}|d	||d
�|j�dS)Nr)�	showerrorz#IDLE's subprocess can't connect to �:r+z.
Fatal OSError #z: zz.
See the 'Startup failure' section of the IDLE doc, online at
https://docs.python.org/3/library/idle.html#startup-failurezIDLE Subprocess Error)�parent)	�tkinterZtkinter.messageboxrXZTk�fix_scalingZwithdraw�errno�strerrorZdestroy)rWrUr[rX�root�msgrrrrT�s*rTcsdddl}|j�t�tj�tj�\}}}}|\t_t_t_t	�����fdd���|||�dS)Nrc	s��jt|��|j}|j}|dk	rNt|��krN�t|�||j�td�d�n:|dk	r�|jr�t|��kr��t|�||j�td�d�|r�tj	|�}td�d�d
}t
||�tj|�d�tj||�}x|D]}t|d�d�q�WdS)NzF
The above exception was the direct cause of the following exception:
)r!zE
During handling of the above exception, another exception occurred:
z"Traceback (most recent call last):�run.py�rpc.py�threading.py�queue.py�
debugger_r.py�bdb.pyr,)�endr!)rarbrcrdrerf)
�add�id�__context__�	__cause__rJ�
__traceback__r5�__suppress_context__rD�
extract_tb�cleanup_traceback�
print_list�format_exception_only)	�typ�excrL�context�causeZtbe�exclude�linesr)�efile�	print_exc�seenrrry�s.



z"print_exception.<locals>.print_exc)
r�
checkcache�flush_stdoutrrrB�	last_type�
last_value�last_traceback�set)rrr�valrLZexcinfor)rxryrzrrC�srCc
Cs|dd�}x2|r>x"|D]}|ddj|�rPqWP|d=qWx2|rrx"|D]}|ddj|�rLPqLWP|d=qBWt|�dkr�|dd�|dd�<tdtjd�tjdj}xftt|��D]V}||\}}}}	|dkr�d}|	o�|j	d��r|j
d	d
||fi�}	||||	f||<q�WdS)
Nrr+z** IDLE Internal Exception: )r!�exec�?z
-toplevel-z	<pyshell#rrr1r1)�count�lenr5rrrZobjecttable�
rpchandlerrO�
startswithZ
remotecall)
rLrvZorig_tbZrpcfiler�rV�fn�lnZnmrrrrro�s2



rocCsdS)Nrrrrrr|sr|cCs*trddl}|j�td�tjd�dS)NrF)r2�atexitZ_clearr&rr<)r�rrrr<s
r<cCsrddl}t|jjdd��}|dkrnxJ|jj|�D]:}|jj||dd�}t|d�}|dkr0td	|�|d<q0WdS)
Nr�tk�scalinggffffff�?T)r_r.�exists�sizeg�?g�)	Ztkinter.font�floatr�Zcallr�namesZFontr3�round)r_r[r�r.rr�rrrr\sr\c@seZdZdd�ZdS)rRcCs�y�Wn�tk
r�Yn�tk
r:datj�Yn�tj}tddd|d�td|d�tdtj	�j
|d�td||d�td	t|�|d�tj
|d�td
|d�tdd|d�datj�YnXdS)NT�
�-�()r!zUnhandled server exception!z
Thread: %szClient Address: z	Request: z#
*** Unrecoverable, server exiting!)rA�EOFErrorr;�thread�interrupt_mainrr6r5r7Zcurrent_threadr.�reprrDryr@)�selfrEZclient_addressZerfrrr�handle_error+s&zMyRPCServer.handle_errorN)r�
__module__�__qualname__r�rrrrrR)srRc@s6eZdZd
dd�Zedd��Zedd��Zdd	�ZdS)�
PseudoFileNcCs||_||_||_dS)N)�shell�tags�	_encoding)r�r�r��encodingrrr�__init__LszPseudoFile.__init__cCs|jS)N)r�)r�rrrr�QszPseudoFile.encodingcCs
d|jS)Nz<%s>)r�)r�rrrr.UszPseudoFile.namecCsdS)NTr)r�rrr�isattyYszPseudoFile.isatty)N)rr�r�r��propertyr�r.r�rrrrr�Js
r�c@seZdZdd�Zdd�ZdS)�PseudoOutputFilecCsdS)NTr)r�rrr�writable_szPseudoOutputFile.writablecCsP|jrtd��t|�tk	r@t|t�s6tdt|�j��tj|�}|jj	||j
�S)Nzwrite to closed filezmust be str, not )�closed�
ValueErrorrJ�str�
isinstance�	TypeErrorr�__str__r�rr�)r�rrrrrbs

zPseudoOutputFile.writeN)rr�r�r�rrrrrr�]sr�c@s:eZdZd
dd�Zdd�Zddd�Zdd	d
�Zdd�ZdS)�PseudoInputFileNcCstj||||�d|_dS)Nr,)r�r��_line_buffer)r�r�r�r�rrrr�oszPseudoInputFile.__init__cCsdS)NTr)r�rrr�readablesszPseudoInputFile.readabler+cCs�|jrtd��|dkrd}nt|t�s8tdt|�j��|j}d|_|dkrlxb|jj	�}|s^P||7}qNWnDx(t
|�|kr�|jj	�}|s�P||7}qnW||d�|_|d|�}|S)Nzread from closed filer+zmust be int, not r,rr1)r�r�r�r3r�rJrr�r��readliner�)r�r��resultrrrr�readvs,


zPseudoInputFile.readcCs�|jrtd��|dkrd}nt|t�s8tdt|�j��|jpF|jj	�}|dkrXt
|�}|jdd|�}|dkrv|d}||d�|_|d|�S)Nzread from closed filer+zmust be int, not rr�r1)r�r�r�r3r�rJrr�r�r�r��find)r�r�rZeolrrrr��s
zPseudoInputFile.readlinecCs|jj�dS)N)r��close)r�rrrr��szPseudoInputFile.close)Nr1)r1r1)r1)rr�r�r�r�r�r�r�rrrrr�ms



r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rScCs�t|�}|jd|�|jd�|_t|jdtj�t_t	|jdtj�t_
t	|jdtj�t_tj
t_
ddl}|j|_tj|_|jd�|_tjj|ddd	�dS)
Nr��console�stdin�stdoutrr�interpg�������?)Zmyseq�wait)�	Executive�register�get_remote_proxyr�r�rr�rr�r�r�rr�displayhook�pydocZ
plainpagerZpagerZ_keep_stdinr��
RPCHandlerZgetresponse)r�Z	executiver�rrr�handle�s


zMyHandler.handlecCstjd�dS)N�
)rPrQ)r�rrr�exithook�szMyHandler.exithookcCsdatj�dS)NT)r@r�r�)r�rrr�EOFhook�szMyHandler.EOFhookcCsdatj�dS)NT)r@r�r�)r�rrr�decode_interrupthook�szMyHandler.decode_interrupthookN)rr�r�r�r�r�r�rrrrrS�srSc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)r�cCs&||_tj|_tj�|_tj�|_dS)N)r��__main__�__dict__�localsrZCalltiprZAutoComplete)r�r�rrrr��s
zExecutive.__init__cCs�y&d|_dazt||j�WddaXWnVtk
r:YnJtj�|_trTt�t	�|j
jjd�}|rx|j
j
j�YnXt�dS)NTFz<<toggle-jit-stack-viewer>>)�usr_exc_info�
interruptabler�r�rArrBr@r<rCr�r�Zgetvarr�Zopen_remote_stack_viewerr|)r��codeZjitrrr�runcode�s"

zExecutive.runcodecCstrtj�dS)N)r�r�r�)r�rrr�interrupt_the_server�szExecutive.interrupt_the_servercCstj|j|�S)N)rZstart_debuggerr�)r�Zgui_adap_oidrrr�start_the_debugger�szExecutive.start_the_debuggercCs|jj|�dS)N)r�Z
unregister)r�Zidb_adap_oidrrr�stop_the_debugger�szExecutive.stop_the_debuggercCs|jj|�S)N)rZ	fetch_tip)r�r.rrr�get_the_calltip�szExecutive.get_the_calltipcCs|jj||�S)N)rZfetch_completions)r�Zwhat�moderrr�get_the_completion_list�sz!Executive.get_the_completion_listNcCsr|jr|j\}}}ndSd}|dk	r0|jj|�}x|rN|jjddkrN|j}q2W|t_|t_t	j
||�}tj|�S)Nrr�run)rr�)
r�r�r��tb_frame�	f_globals�tb_nextrr}r~rZ
StackTreeItemrZremote_object_tree_item)r�Z	flist_oidrrr�rL�flist�itemrrrr�s
zExecutive.stackviewer)N)rr�r�r�r�r�r�r�r�r�rrrrrr��sr�)r	r
rrr
rr)N)NN)F)4�iorr?rrPrD�_threadr�r7r$r[Zidlelibrrrrrrrr��mod�delattr�modulesr9rr"r#r&ZTclr)r*r;r@r�rMr8rTrCror|r<r\Z	RPCServerrR�
TextIOBaser�r�r�r�rS�objectr�rrrr�<module>s`






M$!4+A

Zerion Mini Shell 1.0