Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/idlelib/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/idlelib/__pycache__/pyshell.cpython-312.opt-2.pyc

�

&Μg����ddlZedk(rejdejd<	ddl�ejdk(r
dd	l	m
Z
e
�dd
lmZddlm
Z
ddlZddlZddlZddlZddlmZddlZddlZddlZdd
lmZddlZddlZddlZddlZddlmZddlmZddl m!Z!ddl"m#Z#ddl"m$Z$ddl%m&Z&m'Z'ddl(m)Z)ddl*m+Z+ddl"m,Z,ddl"m-Z-ddl.m/Z/m0Z0m1Z1ddl2m3Z3da4dZ5dZ6	dZ7e7e8_7e7e9_7eja;	d5d�Z<da=d�Z>e>d�dej~fd �Z@e@e_?Gd!�d"e&�ZAGd#�d$e)�ZBGd%�d&e�ZCGd'�d(e3�ZDGd)�d*e!�ZEGd+�d,e-j��ZGd-�ZHGd.�d/e
�ZIGd0�d1e+�ZJd2�ZKd3ZLd4�ZMedk(reM�e>d�y#e$redej��ed��wxYw#e:$rY��wxYw)6�N�__main__zidlelib.pyshell)�*zJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **��file��win32)�
fix_win_hidpi)�
messagebox)�InteractiveInterpreter)�python_version)�TextWrapper)�ColorDelegator)�idleConf)�	Delegator��debugger)�
debugger_r)�EditorWindow�
fixwordbreaks)�FileList)�OutputWindow)�replace)�rpc)�idle_formatwarning�StdInputFile�
StdOutputFile)�
UndoDelegatorFz	127.0.0.1zCtrl-D (end-of-file)c	��	|�t}	|jt|||||���|jd�y#ttf$rYywxYw)N)�linez>>> )�warning_stream�writer�AttributeError�OSError)�message�category�filename�linenorrs      �,/usr/local/lib/python3.12/idlelib/pyshell.py�idle_showwarningr)Cs\����|���
��
�
�%���8�V�$�@�	A��
�
�6����G�$�
��
�s�0<�A�
Ac��	|r't� tjatt_yyt�tt_dayy�N)�_warnings_showwarning�warnings�showwarningr))�captures r(�capture_warningsr0VsD��D�� �(�$,�$8�$8�!�#3�H� �)�!�,�#8�H� �$(�!�-�Tc���	tj}i}t|�D]%}|dd|ddzdk(s�|j|�||<�'||�|j	|�y�Nr���z<>)�	linecache�cache�list�pop�update)r&�orig_checkcacher6�save�keys     r(�extended_linecache_checkcacher=ese���
�O�O�E�
�D��E�{���r��7�S���X���%��	�	�#��D��I���H��	�L�L��r1c�^�eZdZ	d�Zgd�Zdd�Zd�Zdd�Zdd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zy)�PyShellEditorWindowc�r�g|_tj|g|���|jj	d|j
�|jj	d|j�|jj	d|jj�tjjtjd�|_|jj |fd�}|jj#|�|jj$r|j'�|j)�y)N�<<set-breakpoint>>�<<clear-breakpoint>>z<<open-python-shell>>zbreakpoints.lstc�2�|j�|�yr+)�restore_file_breaks)�old_hook�selfs  r(�filename_changed_hookz;PyShellEditorWindow.__init__.<locals>.filename_changed_hook�s���$�$�&��Jr1)�breakpointsr�__init__�text�bind�set_breakpoint_event�clear_breakpoint_event�flist�
open_shell�os�path�joinr�userdir�breakpointPath�io�filename_change_hook�set_filename_change_hookr&rD�color_breakpoint_text)rF�argsrGs   r(rIzPyShellEditorWindow.__init__s���������d�*�T�*��	�	���+�T�-F�-F�G��	�	���-�t�/J�/J�K��	�	���.��
�
�0E�0E�F�!�g�g�l�l�� � �"3�5���,0�7�7�+G�+G�'+�	�	
���(�(�)>�?��7�7����$�$�&��"�"�$r1))�Cutz<<cut>>�rmenu_check_cut)�Copyz<<copy>>�rmenu_check_copy)�Pastez	<<paste>>�rmenu_check_paste)NNN)zSet BreakpointrAN)zClear BreakpointrBNc��	|j�y|r+tj�}tj|d�}nddd�}|jjd|�y)N�break�)�
foreground�
background�BREAK)rUr�CurrentTheme�GetHighlightrJ�
tag_config)rF�color�theme�cfgs    r(rXz)PyShellEditorWindow.color_breakpoint_text�sR��6��7�7�?����)�)�+�E��'�'��w�7�C�!#�2�6�C��	�	���W�c�*r1c��|j}|jj}|jdd|zd|dzz�	|jj|�	|jjjj}|j||�y#t$r|jj|�Y�dwxYw#YyxYw)Nrez%d.0r)
rJrUr&�tag_addrH�index�
ValueError�appendrN�pyshell�interpr�set_breakpoint)rFr'rJr&�debugs     r(rsz"PyShellEditorWindow.set_breakpoint�s����y�y���7�7�#�#�����W�f�v�o�v����/B�C�	,����"�"�6�*�	��J�J�&�&�-�-�6�6�E�� � ��6�2��	�	,����#�#�F�+�	,��
	��s�B�<C�$C�?C�CNc���|j}|jj}|s|j�yt	t|j
d���}|j|�y)N�insert)rJrUr&�bell�int�floatrnrs)rF�eventrJr&r's     r(rLz(PyShellEditorWindow.set_breakpoint_event�sO���y�y���7�7�#�#����I�I�K���U�4�:�:�h�/�0�1�����F�#r1c��|j}|jj}|s|j�yt	t|j
d���}	|jj|�|jddd�	|jjjj}|j||�y#Y�UxYw#YyxYw)Nrvre�insert linestartzinsert lineend +1char)rJrUr&rwrxryrnrH�remove�
tag_removerNrqrrr�clear_breakpoint)rFrzrJr&r'rts      r(rMz*PyShellEditorWindow.clear_breakpoint_event�s����y�y���7�7�#�#����I�I�K���U�4�:�:�h�/�0�1��	����#�#�F�+�	
����!3�/�	1�	��J�J�&�&�-�-�6�6�E��"�"�8�V�4��
	���	��s�C�	<C
�C
�
Cc�J�|jr�|j}|jj}|s|j	�yg|_|jddt�	|jjjj}|j|�yy#YyxYw)Nre�1.0)rHrJrUr&rwr~�ENDrNrqrrr�clear_file_breaks)rFrJr&rts    r(r�z%PyShellEditorWindow.clear_file_breaks�s�������9�9�D��w�w�'�'�H���	�	���!�D���O�O�G�U�C�0�
��
�
�*�*�1�1�:�:���'�'��1���
��s�!;B�B"c��	|j}|jj}	t|j�5}|j�}ddd�	t|jd�5}D](}|j|dz�r�|j|��*|j�|j}|r#|j|dzt|�zdz�ddd�y#1swY��xYw#t$rg}Y��wxYw#1swYyxYw#t$re}t|jdd�sDd|j_
tjddt|�z|j �	�Yd}~yYd}~yd}~wwxYw)
N�w�=�
�breakpoint_error_displayedFTz
IDLE Errorz$Unable to update breakpoint list:
%s)�titler$�parent)rHrUr&�openrT�	readlinesr#�
startswithr!�update_breakpoints�str�getattr�rootr�r
�	showerrorrJ)rF�breaksr&�fp�lines�new_filer�errs        r(�store_file_breaksz%PyShellEditorWindow.store_file_breaks�sI��-�"�!�!���7�7�#�#��	��d�)�)�*�b������+�	&��d�)�)�3�/�8�!�D��?�?�8�c�>�:� ���t�,�"��'�'�)��)�)����N�N�8�c�>�C��K�#?�$�#F�G�0�/�+�*���	��E�	��0�/���	&��4�9�9�&B�E�J�7;��	�	�4��$�$�<�C��c�(�#��9�9�&�&�K��	&�sf�C.�C"�C.�D�*C?�AC?�D�"C+�'C.�.C<�;C<�?D�D�D�	E9�AE4�4E9c���|jj�|j�y|jj}|�ytj
j
|j�r}t|j�5}|j�}ddd�D]I}|j|dz�s�t|t|�dzd�}|D]}|j|���Kyy#1swY�YxYw)Nr�r)rJr9rUr&rPrQ�isfilerTr�r�r��eval�lenrs)rFr&r�r�r�breakpoint_linenumbers�breakpoint_linenumbers       r(rDz'PyShellEditorWindow.restore_file_breakss����	�	�����7�7�?���7�7�#�#�����
�7�7�>�>�$�-�-�.��d�)�)�*�b������+����?�?�8�c�>�2�-1�$�s�8�}�Q��7G�2H�-I�*�1G�-��+�+�,A�B�2H��/�*�*�s�?C(�(C1c�p�	|j}|jd�}|j|�}||_y)Nre)rJ�
tag_ranges�ranges_to_linenumbersrH)rFrJ�ranges�linenumber_lists    r(r�z&PyShellEditorWindow.update_breakpointss4��=��y�y������)���4�4�V�<��*��r1c��g}tdt|�d�D]i}tt||j��}tt||dzj��}||ks�N|j|�|dz
}||kr��k|S)Nr�r)�ranger�rxry�stringrp)rFr�r�rnr'�ends      r(r�z)PyShellEditorWindow.ranges_to_linenumbers#s������1�c�&�k�1�-�E���v�e�}�3�3�4�5�F��e�F�5��7�O�2�2�3�4�C��3�,����V�$��!����3�,�.��r1c�P�	|j�tj|�yr+)r�r�_close�rFs r(r�zPyShellEditorWindow._close4s��A���� ����D�!r1)Tr+)�__name__�
__module__�__qualname__rI�rmenu_specsrXrsrLrMr�r�rDr�r�r��r1r(r?r?|sE��<�%�(�K�
+��$��&
�(&�TC�"+��""r1r?c��eZdZ	eZdZdd�Zy)�PyShellFileListNc��|jr0|jjj�|jSt|�|_|jr|jj	�sy|jSr+)rq�top�wakeup�PyShell�begin�rFrzs  r(rOzPyShellFileList.open_shellCs\���<�<��L�L���#�#�%��|�|��	#�4�=�D�L��|�|��|�|�)�)�+���|�|�r1r+)r�r�r�r?rrqrOr�r1r(r�r�:s��>�'�L��G�r1r�c��eZdZ	d�Zd�Zy)�ModifiedColorDelegatorc�z�|jddd�|jddd�tj|�y)N�TODOr��iomark�SYNC)r~rmr�recolorize_mainr�s r(r�z&ModifiedColorDelegator.recolorize_mainPs0�������x�0����V�U�H�-��&�&�t�,r1c�L�|jD]}|j|dd��y)Nr�r�)�tagdefsr~)rF�tags  r(�removecolorsz#ModifiedColorDelegator.removecolorsUs ���<�<�C��O�O�C��5�1� r1N)r�r�r�r�r�r�r1r(r�r�Ns��>�-�
2r1r�c�0��eZdZ	dd�Zdd�Z�fd�Z�xZS)�ModifiedUndoDelegatorc���	|jj|dd�r|jj�y	t	j
||||�y#t$rY�$wxYw�N�<r�)�delegate�comparerw�TclErrorrrv�rFrn�chars�tagss    r(rvzModifiedUndoDelegator.insert]s_��	��}�}�$�$�U�C��:��
�
�"�"�$��;�
	���T�5�%��6���	��	�s�7A�	A �A c���	|jj|dd�r|jj�y	t	j
|||�y#t$rY�#wxYwr�)r�r�rwr�r�delete)rF�index1�index2s   r(r�zModifiedUndoDelegator.deletefs]��	��}�}�$�$�V�S�(�;��
�
�"�"�$��<�
	���T�6�6�2���	��	�s�7A�	A�Ac�����|jj��fd�|j_	t�|�
|��|j_y#�|j_wxYw)Nc����||d�S�N�stdinr�)rnr��orig_inserts  �r(�<lambda>z2ModifiedUndoDelegator.undo_event.<locals>.<lambda>vs����U�E�7�!Cr1)r�rv�super�
undo_event)rFrzr��	__class__s  @�r(r�z ModifiedUndoDelegator.undo_eventosN���
�m�m�*�*��C�	
�
�
��	/��G��u�%�#.�D�M�M� ��;�D�M�M� �s�A�A"r+)r�r�r�rvr�r��
__classcell__�r�s@r(r�r�[s���A�7�3�/�/r1r�c��eZdZ	dd�Zy)�UserInputTaggingDelegatorNc�F�|�d}|jj|||�yr�)r�rvr�s    r(rvz UserInputTaggingDelegator.inserts"���<��D��
�
���U�E�4�0r1r+)r�r�r�rvr�r1r(r�r�}s
��8�1r1r�c��eZdZd�Zy)�MyRPCClientc��	t�r+)�EOFErrorr�s r(�
handle_EOFzMyRPCClient.handle_EOF�s
��:��r1N)r�r�r�r�r�r1r(r�r��s��r1r�c��	d|xsd�d�}|t|�k\r,t|t|�z
d�\}}||zdz�|�|dz��S|ddS)Nz= RESTART: �Shellz =r�r����)r��divmod)�widthr&r��div�mods     r(�restart_liner��sk���

��+�G�,�B�
/�C���C����5�#�c�(�?�Q�/���S��s�7�C�-����c�#�g�Y�/�/��3�B�x�r1c���eZdZd�ZdZdZdZd�Zd�Zd�Z	d d�Z
d�Zd�Zd	�Z
d
�Zd!d�ZdZd�ZdZd
�Zd�Zd�Zd�ZdZd�Zd"d�Zd�Zd�Zd�Zd"d�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%y)#�ModifiedInterpreterc��||_tjdj}t	j
||��d|_d|_t|_	|jjj|_
y)Nr)�localsF)�	tkconsole�sys�modules�__dict__rrI�
restarting�subprocess_arglist�PORT�port�compile�compiler�flags�original_compiler_flags)rFr�r�s   r(rIzModifiedInterpreter.__init__�s[��"������Z�(�1�1���'�'��V�<����"&�����	�'+�|�|�'<�'<�'B�'B��$r1Nc��|j�|j�|_tj|j�|_yr+)r��build_subprocess_arglist�
subprocess�Popen�
rpcsubprocr�s r(�spawn_subprocessz$ModifiedInterpreter.spawn_subprocess�s7���"�"�*�&*�&C�&C�&E�D�#�$�*�*�4�+B�+B�C��r1c���tjD�cgc]}d|z��	}}tjddddd��}d|�d	�}tjg|zd
|t|j�gzScc}w)Nz-W�main�Generalzdelete-exitfuncF�bool)�default�typez#__import__('idlelib.run').run.main(�)�-c)r��warnoptionsr�	GetOption�
executabler�r�)rF�sr��	del_exitf�commands     r(r�z,ModifiedInterpreter.build_subprocess_arglist�sx�� #���/��!�T�A�X���/��&�&�v�y�:K�/4�6�C�	�7�	�}�A�F������!�#�t�W�c�$�)�)�n�&E�E�E��
0s�A.c�D�t|jf}td�D])}tj|�	t|�|_n|j�y|jjj�d|_tdk7rC|jjjtjtjd�|j!�|jjj#d�	|jj%�|jj+d|j,�|jj+d|j,j.�|jj+d|j,j0�|jj+d|j,j2�|jj+d	|j,j4�|jj+d
t6�|jj+d|�|j9d�
�|j;�|jS#t$rY��awxYw#t&$r|j)�YywxYw)N�rr�
�consoler��stdout�stderrrNr5rrT��with_cwd)�HOSTr�r��time�sleepr��rpccltr#�display_port_binding_error�listening_sock�getsocknamer��
setsockopt�socket�
SOL_SOCKET�SO_REUSEADDRr�
settimeout�accept�TimeoutError�display_no_subprocess_error�registerr�r�rrrNr5�
transfer_path�poll_subprocess)rF�addr�is   r(�start_subprocessz$ModifiedInterpreter.start_subprocess�s����d�i�i� ���q��A��J�J�q�M�
�)�$�/����	�
�+�+�-���K�K�.�.�:�:�<�Q�?��	��1�9�

�K�K�&�&�1�1�&�2C�2C�+1�+>�+>��
C�����	
���"�"�-�-�b�1�	��K�K��� �	
�����Y����7������W�d�n�n�&:�&:�;������X�t�~�~�'<�'<�=������X�t�~�~�'<�'<�=������W�d�n�n�&:�&:�;������[�)�4������X�t�,����D��)������{�{���C�
��
��*�	��,�,�.��	�s#�I3�	J�3	J�?J�J�Jc�(�|jr|jSd|_|j�}|r 	tj|j�|jj�|j
�|j}|j}d|_|j�	|jj�|j|��|j�|jj!dd�|j#d�|j#t%|j&|��|jj)dd�|jj+dd�|s|j-�|r/tj.|j�|j1�|j2|j4j6_d|_|jS#Y���xYw#t$r|j�YywxYw)	NTFrr��end-1cr��restart�left)r�r�getdebuggerr�close_subprocess_debugger�close�terminate_subprocessr��	executingrr&r'r(r*�
stop_readlinerJr�r!r�r��mark_set�mark_gravity�
showprompt�restart_subprocess_debugger�load_breakpointsr�r�r�r�)rFrr&rtr�
was_executings      r(�restart_subprocessz&ModifiedInterpreter.restart_subprocess�s����?�?��;�;������ � �"���
��4�4�T�[�[�A�	
�������!�!�#��.�.���)�)�
�!�������	��K�K��� �	
���H��-����������H�h�/��
�
�d���
�
�l�7�=�=�(�;�<������i��2����!�!�)�V�4����� ���2�2�4�;�;�?��"�"�$�&*�&B�&B������#�����{�{���A
����	��,�,�.��	�s�G-�,G5�-G2�5H�Hc�@�|jjdddi�y)N�exec�interrupt_the_serverr�)r�
remotecallr�s r(�__request_interruptz'ModifiedInterpreter.__request_interrupts�������v�'=�r�2�Fr1c�`�tj|j��j�y)N)�target)�	threading�Thread�'_ModifiedInterpreter__request_interrupt�startr�s r(�interrupt_subprocessz(ModifiedInterpreter.interrupt_subprocesss������ 8� 8�9�?�?�Ar1c��|j�/|jjj|j�	|jj
j
�	|jj
�|j�d|j_	d|_y#t$rY�OwxYw#t$rY�CwxYw�NF)
�_afteridr�rJ�after_cancelrrr5r"r6r7r�s r(�kill_subprocessz#ModifiedInterpreter.kill_subprocesss����=�=�$��N�N���,�,�T�]�]�;�	��K�K�&�&�,�,�.�	��K�K����	
�!�!�#�#(���� ������	��	���	��	�s#�$B%�"B4�%	B1�0B1�4	C�?Cc��		|jj�	|jj�y#t$rYywxYw#t$rYywxYwr+)r�kill�waitr#r�s r(r6z(ModifiedInterpreter.terminate_subprocess%sT��,�		��O�O� � �"�

����$�$�&���
��
��
�	��	�s �A�9�	A�A�	A�Ac��|r#dg}|jtj�ntj}|jdj	|��y)NrbzTif 1:
        import sys as _sys
        _sys.path = {!r}
        del _sys
        
)�extendr�rQ�
runcommand�format)rFrrQs   r(r*z!ModifiedInterpreter.transfer_path2sA����4�D��K�K����!��8�8�D������f�T�l�		r1c�x�|j}|�y	|j|jd��}|r�|jj�d|_|\}}|jj}|dk(r|�ytt|�|��nb|dk(r,|jjd�rB|j�n1|dk(r,d}t||tj ��t|||��	|jj#�|jjsJ|jj&j)|jj*|j,�|_yy#ttt
f$r.|jjrYyd}|j�Y��{wxYw#t$$rY��wxYw)	Ng�������?)rS�OKr�	EXCEPTION�<<toggle-jit-stack-viewer>>�ERRORz/pyshell.ModifiedInterpreter: Subprocess ERROR:
)r�pollresponse�
active_seqr�r#�KeyboardInterruptr��closingr?�resetoutputr�print�repr�getvar�remote_stack_viewerr��
__stderr__�endexecutingr"rJ�after�pollintervalr+rN)rF�clt�response�how�whatr�errmsgs       r(r+z#ModifiedInterpreter.poll_subprocessAsy���k�k���;��	&��'�'����d�'�C�H���N�N�&�&�(�"�D�O� �I�C���n�n�,�,�G��d�{��#��$�t�*�7�3���#��>�>�(�(�)F�G��,�,�.����K���f�d����8��f�d��1�
����+�+�-��~�~�%�%� �N�N�/�/�5�5����+�+�T�-A�-A�C�D�M�&��9�'�#4�5�	&��~�~�%�%���H��#�#�%�
	&��2"�
��
�s)�E(�-F-�(*F*�F*�)F*�-	F9�8F9c��||_yr+r)rFrs  r(�setdebuggerzModifiedInterpreter.setdebuggeris	�� ��
r1c��|jSr+rr�s r(r3zModifiedInterpreter.getdebuggerls���}�}�r1c�f�	|jjjd|j�y)Ni,)r�rJrhrer�s r(�open_remote_stack_viewerz,ModifiedInterpreter.open_remote_stack_vieweros,��	�	
�����!�!�#�t�'?�'?�@�r1c��ddlm}|jjdddi�}|�%|jj
j
�y|j|j|�}ddlm	}m
}t|jj
�}tj�}tj|d�d}|||d�	�}	|	jj!d
d��||	j"d|�}
|
j%�y)
Nr)�
debugobj_rrA�stackviewer)rN)�ScrolledCanvas�TreeNode�normalrd)�bg�highlightthicknessr�both)�expand�fill)�idlelibrur�remotequeuer�r�rw�StubObjectTreeItem�idlelib.treerwrx�Toplevelrrfrg�frame�pack�canvasr})rFru�oid�itemrwrxr�rjrd�sc�nodes           r(rez'ModifiedInterpreter.remote_stack_viewer|s���&��k�k�%�%�f�m�Z��L���;��N�N���$�$�&���,�,�T�[�[�#�>��9��t�~�~�*�*�+���%�%�'���*�*�5�(�;�L�I�
�
�C�J�1�
E��
���
�
�Q�V�
�,���	�	�4��.�����
r1rc�L�	|j|�}|j||�yr+)�stuffsource�execfile�rF�sourcer&s   r(�
execsourcezModifiedInterpreter.execsource�s#��;��#�#�F�+���
�
�h��'r1c��	|�]tj|�5}|j�}tr)dtj
j
|��d�|zdz}ddd�	t||d�}|j|�y#1swY�)xYw#ttf$rn|jj�td|jj��tj ||�|jj#�YywxYw)Nz__file__ = r'''z'''
z
del __file__rAzB*** Error in script or command!
Traceback (most recent call last):r)�tokenizer��read�use_subprocessrPrQ�abspathr��runcode�
OverflowError�SyntaxErrorr�rarbrr�showsyntaxerrorr;)rFr&r�r��codes     r(r�zModifiedInterpreter.execfile�s���"��>����x�(�B������!� /�������0I�/J�%�P� &�'�)9�:�F�)�

	��6�8�V�4�D�
�L�L���)�(���{�+�	(��N�N�&�&�(��6��~�~�,�,�
.�
#�2�2�4��B��N�N�%�%�'�
	(�s�AB�"
B
�B
�
A:D
�	D
c�T�	|j|�}tj|||�Sr+)r�r�	runsourcer�s   r(r�zModifiedInterpreter.runsource�s,��L��#�#�F�+��
&�/�/��f�h�G�Gr1c��	d|jz}|jdz|_|jd�}t|�dzd||ftj|<|S)Nz<pyshell#%d>rr�r)�gid�splitr�r5r6)rFr�r&r�s    r(r�zModifiedInterpreter.stuffsource�sT��,�!�D�H�H�,���8�8�a�<������T�"��$'��K��M�1�e�X�$E�	����!��r1c�F�	|jdj|��y)Na*if 1:
            _filename = {!r}
            import sys as _sys
            from os.path import dirname as _dirname
            _dir = _dirname(_filename)
            if not _dir in _sys.path:
                _sys.path.insert(0, _dir)
            del _filename, _sys, _dirname, _dir
            
)rVrW�rFr&s  r(�prepend_syspathz#ModifiedInterpreter.prepend_syspath�s"��H������&��"�	$r1c���	|j}|j}|jddd�tj�\}}}t|dd�xs|xsd}t|dd�xsd}	t|d	d�xsd
}
|
d
k(r|	dz
}	|	dk(r	d|
dz
z}n
d|	dz
|
dz
fz}|j
||�|j�|jd
|z�|j�y)Nr\r�r��msgrbz<no detail available>r'r�offsetrziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
)
r�rJr~r��exc_infor��colorize_syntax_errorrar!r;)rFr&�kwargsr�rJr	�value�tbr�r'r��poss            r(r�z#ModifiedInterpreter.showsyntaxerror�s���	��N�N�	��~�~��������.��,�,�.���e�R��e�U�B�'�K�5�K�4K�����"�-�2������"�-�2����Q�;��a�K�F��Q�;�%����2�C�:��!�8�V�A�X�&�'�C��'�'��c�2������
�
�&��,�-����r1c���	|jj�|j�tj|�|jjd�r|jj
�yy)Nr[)r�ra�checklinecacher�
showtracebackrd�open_stack_viewerr�s r(r�z!ModifiedInterpreter.showtraceback�sX��;����"�"�$������,�,�T�2��>�>� � �!>�?��N�N�,�,�.�@r1c�j�	tj}t|�D]}|dd|ddzdk7s�||=�yr3)r5r6r7)rFr6r<s   r(r�z"ModifiedInterpreter.checklinecache�s<��/�������;�C��2�A�w��R�S��!�T�)��#�J�r1c���	|jjr|j�y|jr |jj	dd|fi�yt||j�y)NrrAr�r)r�r7�display_executing_dialogrr�rAr�)rFr�s  r(rVzModifiedInterpreter.runcommand�sZ��4��>�>�#�#��)�)�+���;�;��K�K�#�#�F�I��w��C��
��t�{�{�#�r1c��	|jjr|j�|j�|j}	|jj�|s1|j�%|jjdd|fi�|_n6|r|j||j�nt||j�t$s	|jj+�yy#t$rY|jjs?tjddd|jj ��r�|j#�n�Y��t$rLt'd|jj(��|j#�|jj+�nY|jj,r3d	|j_t'd
|jj(��n|j#�Y��3xYw#t.$rYywxYw#t$s+	|jj+�w#t.$rYwwxYwwxYw)NrAr�zExit?zDo you want to exit altogether?�yes�rr�z IDLE internal error in runcode()rFr_)r�r7r?r�r�beginexecutingr�
asyncqueuer^�runr�rA�
SystemExitr`r
�askyesnorJr�r�rbrrg�canceledr")rFr�rs   r(r�zModifiedInterpreter.runcode�s���$��>�>�#�#��#�#�%������=�=��&	��N�N�)�)�+����� 7�"&�+�+�"8�"8���9=���#E��������T�4�;�;�/��T�4�;�;�'�4"���N�N�/�/�1�"��3�	��>�>�)�)��&�&��5�!��>�>�.�.�	0�
��&�&�(��)�	)���8��>�>�0�0�2��"�"�$����+�+�-��>�>�*�*�.3�D�N�N�+��-�D�N�N�4I�4I�J��&�&�(��
&�����"���N�N�/�/�1��%�����"�s]�BC+�G>�+AG;�
H
�B,G;�8H
�>	H
�	H
�
I�H0�/I�0	H<�9I�;H<�<Ic�N�	|jjj|�Sr+)r�rr!)rFrs  r(r!zModifiedInterpreter.write(s ��$��~�~�$�$�*�*�1�-�-r1c�\�tjdd|jj��y)NzPort Binding ErroraAIDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server.  This might be because no networking is installed on this computer.  Run IDLE with the -n command line switch to start without a subprocess and refer to Help/IDLE Help 'Running without a subprocess' for further details.�r��r
r�r�rJr�s r(rz.ModifiedInterpreter.display_port_binding_error,s'����� �
/��>�>�&�&�	(r1c�\�tjdd|jj��y)NzSubprocess Connection Errorz�IDLE's subprocess didn't make connection.
See the 'Startup failure' section of the IDLE doc, online at
https://docs.python.org/3/library/idle.html#startup-failurer�r�r�s r(r(z/ModifiedInterpreter.display_no_subprocess_error7s(�����)�
J��>�>�&�&�	(r1c�\�tjdd|jj��y)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.r�r�r�s r(r�z,ModifiedInterpreter.display_executing_dialog?s%������
0��>�>�&�&�		(r1)Frb)Fr+)&r�r�r�rIrNrrrr�r.r?rIrKrPr6r*r^r+rrpr3rsrer�r�r�r�r�r�r�r�r�rVr�r!rr(r�r�r1r(r�r��s���C��H�
�F��J�D�

F�)�V*�XG�B�
����J�$C�L�H�!����"�C�(�
�(H��
$��4/��
�,�\.�	(�(�(r1r�c	�P��eZdZddlmZde�zZeZe	Z
gd�ZejdgzZ
deeej"d�e
���zZe
j'ed�[d	Zd
ZddlmZddlmZd9d
�Z�fd�Z�fd�Zd�Zd�Zd�Zd9d�Z d	Z!d	Z"d	Z#d	Z$d	Z%d	Z&d�Z'd�Z(d9d�Z)d�Z*d9d�Z+d�Z,d�Z-d�Z.d�Z/d�Z0d�Z1d�Z2d �Z3d!�Z4d"Z5d#�Z6d$�Z7d%�Z8d&�Z9d9d'�Z:d(�Z;d)�Z<d*�Z=d+�Z>e?j�d,�ZAd-�ZBd9d.�ZCd9d/�ZDd9d0�ZEd1�ZFd2�ZGd3�ZHd:d4�ZI�fd5�ZJ�fd6�ZKd9d7�ZLd8�ZM�xZNS);r�r)�SqueezerzIDLE Shell ))r�_File)�edit�_Edit)rt�_Debug)�options�_Options)�window�_Window)�help�_Help)�Squeeze�<<squeeze-current-text>>rc��|ddk7S)Nrr\r�)�
rmenu_items r(r�zPyShell.<lambda>_s
��:�a�=�F�2r1)zCopy with prompts�<<copy-with-prompts>>r]Fr�)�History)�ShellSidebarc��tr)|j}|dddk7r|jdd�t|�|_|�0t�}t
|�|j�t|�}d|_	tj||dd�d|_d|_
ttd�rtj nd|_|j"j%d	�d
|_|j"|_|j*}|j-d��|j/d
|j0�|j/d|j2�|j/d|j4�|j/d|j6�|j/d|j8�|j/d|j:�|j/d|j<�|j/d|j>�tr8|j/d|j@�|j/d|jB�|jE|�|_#|j/d|jH�tjJ|_&tjN|_(tjR|_*ddl+m,}t[|d|j\|j^�|_)ta|d|j\|j^�|_%ta|d|j\d�|_'ta|d|j\|j^�|_1ts?|jJt_%|jNt_'|jRt_)	ddl2}|jf|_4|jm|j*�|_7d|_8|js|�|_	|jtjvj|j*_|jtjyt{��y#tjjt_'�xYw)Nr�r�shell)r��She_llF��ps1z>>>
r�r4�char)�wrapz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>>�<<toggle-debugger>>r[r�z<<view-restart>>z<<restart-shell>>r�)�iomenur�rr�backslashreplacer�2)>r��
menu_specsrvr�rr�Tkr�withdrawr��
shell_sidebarrrI�usetabs�indentwidth�hasattrr�r��sys_ps1r��prompt_last_line�promptrJ�	configurerK�enter_callback�linefeed_callback�cancel_callback�eof_callbackr��toggle_debugger�toggle_jit_stack_viewer�copy_with_prompts_callback�view_restart_mark�
restart_shellr��squeezer�squeeze_current_text_eventr�save_stdoutr�save_stderrr��
save_stdinrr�r�encoding�errorsrr�pydoc�
plainpager�pagerrfr��historyrir��perr��insertfilterr�)rFrN�msr�rJr�r�s       r(rIzPyShell.__init__ms*������B��!�u�Q�x�7�"��	�	�!�0�1�)�$�/����=��4�D��$���M�M�O�#�D�)�E�!������d�E�4��6�������")�#�u�"5�s�w�w�7��� $��� 2� 2�4� 8�� <����l�l����y�y�����F��#��	�	�*�D�,?�,?�@��	�	�0�$�2H�2H�I��	�	�+�T�-A�-A�B��	�	�#�T�%6�%6�7��	�	�)�4�+A�+A�B��	�	�'��)=�)=�>��	�	�/��1M�1M�N��	�	�)�4�+J�+J�K���I�I�(�$�*@�*@�A��I�I�)�4�+=�+=�>��
�
�d�+��
��	�	�,��1�1�	3��:�:����:�:����)�)���"�!�$��"(�/�/�6�=�=�B��
�#�D�(�$*�O�O�V�]�]�D���#�D�(�$*�O�O�5G�I���$�T�9�%+�_�_�f�m�m�E�������C�J����C�J��
�
�C�I�	���*�*�E�K�
�|�|�D�I�I�.������!�.�.�t�4���
 �8�8�<�<�.�.��	�	�������7�9�:��	����C�J��s�P*�*Qc�p��t�|��|j�|jj�yyr+)r��	ResetFontr��update_font�rFr�s �r(rzPyShell.ResetFont�s1���
�������)����*�*�,�*r1c���t�|��tj�}ddd�tj|d�tj|d�tj|d�d�}|j�D]"\}}|jj|fi|���$|j�|jj�yy)N)rdrcrrry)r�rrr)
r��ResetColorizerrrfrg�itemsrJ�
tag_configurer��
update_colors)rFrj�
tag_colorsr��tag_colors_configr�s     �r(rzPyShell.ResetColorizer�s����
��� ��%�%�'��"&�d�;��)�)�%��:��)�)�%��:��*�*�5�(�;�	
�
�'1�&6�&6�&8�"�C�"�#�D�I�I�#�#�C�=�+<�=�'9����)����,�,�.�*r1c�F�tj|jd��y)Nr�)�insert_tagsra)rrJr�s  r(�
replace_eventzPyShell.replace_event�s������	�	�w�7�r1c�.�tjd��S)NT)�
shell_only)r�
GetExtensionsr�s r(�get_standard_extension_namesz$PyShell.get_standard_extension_names�s���%�%��6�6r1c�p�	|jj||�}ttt	|��tt	|���}|D�cgc]'}|j
jj|���)}}djd�t||j��D��dzScc}w)Nr�c3�8K�|]\}}|�|n|�d|�����y�w)N� r�)�.0r�rs   r(�	<genexpr>z*PyShell.get_prompt_text.<locals>.<genexpr>�s0����
� ?�����N�D�6�(�!�D�6�(:�:� ?�s�)
rJ�getr�rxryr��line_promptsrR�zip�
splitlines)rF�first�lastrJ�lineno_ranger'�promptss       r(�get_prompt_textzPyShell.get_prompt_text�s���D��y�y�}�}�U�D�)�����e�����d�����'�
�&��
���+�+�/�/��7�&�	�
��y�y�
� #�G�T�_�_�->� ?�
�
�
��	��	
s�,B3c��	|j}|jd�}|�y|jd�}|ddk7r|jd�}|j�|j||�}|j	|�y)Nzsel.first linestart�sel.lastr4�0zsel.last+1line linestart)rJrn�clipboard_clearr!�clipboard_append)rFrzrJ�selfirst�sellast�prompt_texts      r(r�z"PyShell.copy_with_prompts_callback�s��	��y�y���:�:�3�4������*�*�Z�(���2�;�#���j�j�!;�<�G������*�*�8�W�=�����k�*r1c��|ayr+�r )rF�streams  r(�set_warning_streamzPyShell.set_warning_streams���r1c��tSr+r+r�s r(�get_warning_streamzPyShell.get_warning_streams���r1c��|jr3tjdd|j��|j	�y|j
j
�}|r|j�y|j�y)NzDon't debug nowz*You can only toggle the debugger when idler�ra)	r7r
r�rJ�set_debugger_indicatorrrr3�close_debugger�
open_debugger)rFrz�dbs   r(r�zPyShell.toggle_debuggersb���>�>�� � �!2�<��y�y�
"�
�'�'�)�����(�(�*�B���#�#�%��"�"�$r1c�`�|jj�}|jd|�y)Nr�)rrr3�setvar�rFr4s  r(r1zPyShell.set_debugger_indicators'��
�[�[�
$�
$�
&�����)�2�v�:�6r1c��yr+r�r�s  r(r�zPyShell.toggle_jit_stack_viewers��r1c���|jj�}|r�|jjd�|j�|jjr)tj|jj�|j�|jjd�|j|_|j�|j�y)Nz[DEBUG OFF]
)rrr3rpr5rr�close_remote_debuggerrarr!r�r�r;r1r7s  r(r2zPyShell.close_debugger s���
�[�[�
$�
$�
&��
��K�K�#�#�D�)��H�H�J��{�{�!�!��0�0����1C�1C�D������L�L����/��,�,�D�K��O�O���#�#�%r1c�n�|jjr+tj|jj|�}nt	j
|�}|jj
|�|j�d|jz|_	|j�|j�y)Nz[DEBUG ON]
)rrrr�start_remote_debuggerr�Debuggerrpr=r�r�r;r1)rF�dbg_guis  r(r3zPyShell.open_debugger-s����;�;��� �6�6�t�{�{�7I�7I�;?�A�G��'�'��-�G�������(�� � �"�$�t�|�|�3��������#�#�%r1c�J�|jrdnd}|jdd|�y)N�disabledryrtz*tack*iewer)r7�update_menu_state)rF�states  r(�debug_menu_postcommandzPyShell.debug_menu_postcommand9s!��"�n�n�
�(�����w�
�u�=r1c�4�	|j�d|_y�NT)rar7r�s r(r�zPyShell.beginexecuting=s��(�������r1c�B�	d|_d|_|j�yrM)r7r�r;r�s r(rgzPyShell.endexecutingBs��(������
����r1c���	|jr(tjddd|j��}|dury|j	�d|_d|_tj|�S)NzKill?z7Your program is still running!
 Do you want to kill it?�okr�F�cancelT)	r7r
�askokcancelrJr8r�r`rr5)rFrks  r(r5z
PyShell.closeHsd��%��>�>�!�-�-��J���y�y�	"�H�
�5� ��������
�����!�!�$�'�'r1c�Z�	|j�tr|jj�|jt
_|jt
_|jt
_
d|_d|_d|j_
d|_tj |�yr+)r2r�rrrPr�r�rr�rr�r�rrNrqr�rr�r�s r(r�zPyShell._closeWsx��O�������K�K�'�'�)��%�%��
��%�%��
��O�O��	�������!��
�
��������D�!r1c��	yrEr�r�s  r(�ispythonsourcezPyShell.ispythonsourcegs��B�r1c��|jSr+)�shell_titler�s r(�short_titlezPyShell.short_titleks�����r1zHType "help", "copyright", "credits" or "license()" for more information.c
��|jjdd�|j�tr/d}|jj�}|s,|j
�yd}tjt_|jdtj�dtj�d|j�d|���|jj�|j�d	dl}d
|_d|_y
)Nr�rvrbFz�==== No Subprocess ====

WARNING: Running IDLE without a Subprocess is deprecated
and will be removed in a later version. See Help/IDLE Help
for details.

zPython z on r�rT)rJr9rar�rrr.r5r�displayhookr�r!�version�platform�	COPYRIGHT�focus_forcer;�tkinter�_support_default_root�
_default_root)rF�nosub�clientrWs    r(r�z
PyShell.beginqs����	�	���8�X�.�������E��[�[�1�1�3�F���
�
���'�E�"�o�o�C�O��
�
��K�K����t�~�~�u�F�	G��	�	���������(,��%� $���r1c�`�|jsyd|_|jj�yrE)�reading�_stop_readline_flagr��quitr�s r(r8zPyShell.stop_readline�s!���|�|��#'�� ����
�
�r1c��|j}	d|_|jj�||_|jrd|_y|jjdd�}t
|�dk(rd}|j�|jrd|_tst�|jr	d|_d}|S#||_wxYw)NTFrbr�r0rr�)r]r��mainloopr^rJrr�rar�r�r_�	endoffile)rFr;rs   r(�readlinezPyShell.readline�s����|�|��	 ��D�L��H�H�����D�L��#�#�',�D�$���y�y�}�}�X�x�0���t�9��>��D������=�=�!�D�M�!�'�'��>�>�"�D�N��D���� �D�L�s�!B<�<	Cc��yrEr�r�s r(�isattyzPyShell.isatty�s��r1c�D�	|jjddd�ry	|jsH|js<|j	�|j
j
d�|j�yd|_d|_	|jre|j
jrO|j
j�r|j
j�n|j
j�|jr|jj�y#Y��xYw)N�	sel.firstz!=r#zKeyboardInterrupt
raFT)rJr�r7r]rarrr!r;rbr�rr3r?rKr�r_r�s  r(r�zPyShell.cancel_callback�s���	��y�y� � ��d�J�?��@����$�,�,������K�K���3�4��O�O��������
��N�N�t�{�{�1�1��{�{�&�&�(����.�.�0����0�0�2��<�<��H�H�M�M�O���!	��s�D�Dc�V�|jr
|jsy|jjddd�r|jjddd�sy|js!|j	�|j�yd|_d|_|jj�y)Nr�z==rvr0FTra)
r7r]rJr�rar5r�rbr�r_r�s  r(r�zPyShell.eof_callback�s����>�>�$�,�,���	�	�!�!�(�D�(�;��	�	�!�!�(�D�(�;���~�~������J�J�L�
�"�D�M�!�D�N��H�H�M�M�O�r1c��|jr8|jjdd�|jjd�y|j	|�y)Nrvr�ra)r]rJrv�see�newline_and_indent_eventr�s  r(r�zPyShell.linefeed_callback�sE���<�<��I�I���X�t�,��I�I�M�M�(�#��
�)�)�%�0�r1c�r	�|jr
|jsy	|jjdd�}|r0|jj	ddd�r|j||�y|jj	ddd��r�|jj
d	d�}|�r#|jj	dd|d
��rd|jjd�vr�|jj
dd�}|r-|jj	|d
d|d
�r
|d
|d
f}|jjdd�}|rI|jj	|d
d|d
�r&|d
|jj|d
dz�f}|j|jj|d
|d
�|�y|jjd	d�}|r�|jj	dd|d
�r�|jjdd�}|rI|jj	|d
d|d
�r&|d
|jj|d
dz�f}|j|jj|d
|d
�|�y|jjdd�}|rP|jj	|d
dd�r0|j|jj|d
d�|�y|j|jjdd�|�y|jj	ddd�r|jjdd�|jjdd�}|r,|j�s|jjdd�|jj	ddd�r|j|�y|jjdd�|jr8|jjdd�|jjd�n|j|�|jj!�|jr|j"j%�y|j'�y#Y��MxYw)Nrgr#z<=r�rarvr��iomark linestartr�rrz>=rz+1czinsert lineendr|r0zend-1c linestartr�)r7r]rJrr��recall�
tag_prevrange�	tag_names�
tag_nextrangernr9�stripr�rkrvrj�update_idletasksr�r_�runit)	rFrz�sel�prev�	prev_cons�	next_cons�next�indicesrs	         r(r�zPyShell.enter_callback�s����>�>�$�,�,��	��)�)�-�-��Z�8�C���9�9�$�$�Z��x�@��K�K��U�+�"��9�9���X�s�,>�?�
�9�9�*�*�7�H�=�D���I�I�%�%�h��T�!�W�=��T�Y�Y�%8�%8��%B�B� �I�I�3�3�I�x�H�	�����!2�!2�9�Q�<��t�A�w�!O�%�a�L�$�q�'�2�D� �I�I�3�3�I�x�H�	�����!2�!2�9�Q�<��d�1�g�!N� ��G�T�Y�Y�_�_�Y�q�\�E�5I�%J�K�D����D�I�I�M�M�$�q�'�4��7�;�U�C���9�9�*�*�7�H�=�D���	�	�)�)�*:�D�$�q�'�J� �I�I�3�3�I�?O�P�	�����!2�!2�9�Q�<��d�1�g�!N� ��G�T�Y�Y�_�_�Y�q�\�E�5I�%J�K�D����D�I�I�M�M�$�q�'�4��7�;�U�C���i�i�-�-�i�9K�L�G���y�y� � ����T�3E�F����D�I�I�M�M�'�!�*�6F�G��O�����D�I�I�M�M�*<�>N�O�QV�W���9�9���X�s�H�5��I�I���x��2�
�I�I�M�M�(�H�-���Q�W�W�Y��I�I���X�x�0��9�9���X�s�,>�?��)�)�%�0���	�	���8�X�.��<�<��I�I���X�t�,��I�I�M�M�(�#��)�)�%�0��	�	�"�"�$��<�<��H�H�M�M�O��
�J�J�L���E	��s�A
R1�1R6c���tjdd|�}tjdd|�}|jd�}|jj	�	|jjddd�|jj
dd	�|jjd
d�}|j�jd�r-|j|�|jjd
d�}|jjd|dj�|j�t|�d
kDr�tjd|d�j!d�}tjd|�j!d�}|d
dD]\}|j#|�r||t|�dz}|jjdd|j�z|j��^|jj%d�|jj'�y#|jj%d�|jj'�wxYw)Nz^\s*\nrbz\n\s*$r�rur�r�rvr0r|�:rrz	^([ \t]*))�re�subr�rJ�undo_block_startr~r9r�rstrip�endswithrkrvrr�user_input_insert_tagsr��search�groupr�rj�undo_block_stop)rFrrzr��prefix�orig_base_indent�new_base_indentrs        r(rnzPyShell.recall(s����F�F�9�b�!�$���F�F�9�b�!�$������
���	�	�"�"�$�	(��I�I� � ���u�5��I�I���x��2��Y�Y�]�]�#5�x�@�F��}�}��'�'��,��-�-�e�4������'9�8�D���I�I���X�u�Q�x�~�~�'7�!�8�8�
:��5�z�A�~�#%�9�9�\�5��8�#D�#J�#J�1�#M� �#%�9�9�\�6�#B�#H�#H��#K��!�!�"�I�D����'7�8�.��c�:J�6K�6L�1M�M���I�I�$�$�X�t�d�k�k�m�/C�%)�%@�%@�B�	&�
�I�I�M�M�(�#��I�I�%�%�'��
�I�I�M�M�(�#��I�I�%�%�'�s
�FH)�)7I z[ \t]*(\n[ \t]*)?\Zc��|jjd�}|jjdd�}|jj	d|�}|j
j
|�}|s_|jj|�dk(r&|jj|j|�|jj�yy)N�end-2cr�r0rbr�)rJrnr�_last_newline_rer~rrr�r~r�r��update_sidebar)rF�index_beforer�input_is_completes    r(rtz
PyShell.runitEs����y�y���x�0���y�y�}�}�X�x�0���$�$�(�(��T�2�� �K�K�1�1�$�7�� ��y�y�}�}�\�*�d�2��	�	�$�$�T�%@�%@�,�O����-�-�/�!r1c��|jjr|jj�Sddlm}	||j
tj|j�y#tjdd|j��YyxYw)Nr)�StackBrowserzNo stack tracez:There is no stack trace yet.
(sys.last_exc is not defined)r�)rrrre�idlelib.stackviewerr�r�r��last_excrNr
r�rJ)rFrzr�s   r(r�zPyShell.open_stack_viewerQsp���;�;����;�;�2�2�4�4�4�	"�����C�L�L�$�*�*�=���	"�� � �!1�0��y�y�
"��s�,A%�%$Bc�p�|jjd�|jjd�y)Nr�r1)rJrjr�s  r(r�zPyShell.view_restart_mark_s"���	�	�
�
�h���	�	�
�
�i� r1c�>�	|jjd��y)NTr)rrr?r�s  r(r�zPyShell.restart_shellcs��0����&�&��&�5r1c���|j�|j}|jr4|j|j�r|dt	|j�}|j
j
dd�|jj|�|jj�|j
jdd�|j�|jj�y)Nrz	iomark-1crvr0)rar�r�r�r�rJrmrr!r�r�r9�set_line_and_columnrU�
reset_undo)rFr�s  r(r;zPyShell.showpromptgs������������<�<�F�O�O�D�L�L�9��/�c�$�,�,�/�/�0�F��	�	���)�[�1������6�"����)�)�+��	�	���8�X�.�� � �"������r1c��|jjj}t|dd��}dj	|j|��}|j
d�s|dz
}|jjjd|d�y)N�T)r��tabsize�expand_tabsr�rmr)
rrr�r�r
rRr�r�r��bottomrv)rFr�r��wrapper�wrapped_msgs     r(�show_warningzPyShell.show_warninguso�����%�%�+�+���E�1�$�G���i�i����S� 1�2���#�#�D�)��4��K��������1�;��Ir1c��|jjdd�}|jr|jj|�|jjd�dk7r|jj	dd�|jjdd�|j
�|jj�y)Nr�r0r�r�)	rJrr��storervr9r��ctip�remove_calltip_window)rFr�s  r(razPyShell.resetoutput}s��������x��2���<�<��L�L���v�&��9�9�=�=��"�d�*��I�I���X�t�,��	�	���8�X�.�� � �"��	�	�'�'�)r1c���	|jjdd�tj|||d�}|jjdd�|jrd|_t
st�|S#�xYw)Nr��rightr2F)rJr:rr!r�r�r_)rFrr��counts    r(r!z
PyShell.write�sm��	��I�I�"�"�8�W�5� �&�&�t�Q��h�?�E��I�I�"�"�8�V�4��=�=�!�D�M�!�'�'����	��s�AA3�3A6c�~��	|jjddd�ry	t�|��S#t$rYywxYw)Nrgr�r�r@)rJr�r�r�r[rs �r(r[zPyShell.rmenu_check_cut�sJ���	��y�y� � ��c�8�<�!�=��w�&�(�(���	��	�s�0�	<�<c�\��|jjddd�ryt�|�
�S)Nrvr�r�r@)rJr�r�r_rs �r(r_zPyShell.rmenu_check_paste�s*����9�9���X�c�(�3���w�(�*�*r1c�l�|jj�|jj�yr+)r��squeeze_current_textr�r�r�s  r(r�z"PyShell.squeeze_current_text_event�s$���
�
�*�*�,����)�)�+r1c�8�|jj�yr+)r�r�)rFrnrJr�s    r(�on_squeezed_expandzPyShell.on_squeezed_expand�s�����)�)�+r1r+)r�)Or�r�r��idlelib.squeezerr�rrOr�rr�rr�rr�r�r7�	itertools�	takewhile�_idxrv�allow_line_numbersr��idlelib.historyr��idlelib.sidebarr�rIrrrrr!r�r]r7r�rbr`r^r-r/r�r1r�r2r3rCr�rgr5r�rMrPrUr�r8rcrer�r�r�r�rnr}r�r�rtr�r�r�r;r�rar!r[r_r�r�r�r�s@r(r�r�Gs����)��.�"2�2�K�,�N�)�M��J��*�*�/�.��K�
�s�4�+�	�+�+�2�K�A����D����t�2�3�	
���$��(�,�L;�\-�/� �7��"+�(�G��I��H��I��G��� ��%�7�
�&�
&�>��
�
(�"� � �U���4��.��,
��M�^(�8"�r�z�z�"8�9��
0��!�6��J�*��)�+�
,�,r1r�c
��	|jdk(r.dD](}|j|dd|j|d�z��*yy)N�x11)�Text�Entry�Spinboxz	<<Paste>>z%catch {%W delete sel.first sel.last}
)�_windowingsystem�
bind_class)r��clss  r(�
fix_x11_paster��sJ��<�����%�-�C��O�O���8�����[�9�:�
;�.�&r1a�
USAGE: idle  [-deins] [-t title] [file]*
       idle  [-dns] [-t title] (-c cmd | -r file) [arg]*
       idle  [-dns] [-t title] - [arg]*

  -h         print this help message and exit
  -n         run IDLE without a subprocess (DEPRECATED,
             see Help/IDLE Help for details)

The following options will override the IDLE 'settings' configuration:

  -e         open an edit window
  -i         open a shell window

The following options imply -i and will open a shell:

  -c cmd     run the command in a shell, or
  -r file    run script from file

  -d         enable the debugger
  -s         run $IDLESTARTUP or $PYTHONSTARTUP before anything else
  -t title   set title of shell window

A default edit window will be bypassed when -c, -r, or - are used.

[arg]* are passed to the command (-c) or script (-r) in sys.argv[1:].

Examples:

idle
        Open an edit window or shell depending on IDLE's configuration.

idle foo.py foobar.py
        Edit the files, also open a shell if configured to start with shell.

idle -est "Baz" foo.py
        Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
        window with the title "Baz".

idle -c "import sys; print(sys.argv)" "foo"
        Open a shell window and run the command, passing "-c" in sys.argv[0]
        and "foo" in sys.argv[1].

idle -d -s -r foo.py "Hello World"
        Open a shell window, run a startup script, enable the debugger, and
        run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
        sys.argv[1].

echo "import sys; print(sys.argv)" | idle - "foobar"
        Open a shell window, run the script piped in, passing '' in sys.argv[0]
        and "foobar" in sys.argv[1].
c	��ddl}ddlm}ddlm}ddlm}t
d�dad}d}d}d}d}d}		|jtjddd�\}
}
D]�\}
}|
d
k(r|}d}|
dk(rd}d}|
dk(rd}|
dk(r7tjj!t�tj�|
dk(rd}|
dk(rtdtj��da|
dk(rD|}t"j$j'|�rn td|�tj�d}|
dk(rd}	d}|
dk(s��|t(_d}��r(|ddk(r tj,j/�}d}t1t3tj$��D]C}t"j$j5tj$|�tj$|<�E|r|ddk(rdg|ddzt_	n�|rd
g|zt_	n�|r|g|zt_	n�|r�d}g}|D]0}|j7t"j$j9|���2|D]T}t"j$j5|�}|tj$vs�5tj$j;d|��VnFt#j<�}|tj$vr tj$j;d|�t?j@dddd��}|xs|}|xs|}tr|s
tC�tEd� �a#tFjI�dd!l%m&}|tF�t"j$jOt"j$j9tP�d"�}|�d#k(r7t"j$jO|d$�}tFjS|�%�n�|jU�sxtVd&k\rd'}d(}nd)}d*}|D�cgc]'}t"j$jO|d+||fz���)}}|D�cgc]}tYtF|�,���}}tGjZdg|���t]tF�t_tF�tatF�a1|jetFtb�|rK|sI|sG|ddD])}tbjg|���|ji|��+|stbjk�|rRtbjm�}|sy|jU�r;tbjnr+|jpjs�ntbjt}|r|jw�|	r|t"jxj{d-�xst"jxj{d.�}|r:t"j$j'|�r|j|j|�|s|r�|j|j�d/j�tj��|r|j|j�|�n^|r\|j|j�|�|j|j|�n%|r#|j��}|r|j�|�tbj�r%tFj��tbj�r�%tFj��t
d�y#|j$rE}td	|�d
t��tj��tjd�Yd}~���d}~wwxYwcc}wcc}w)0Nr)�system)�testing)�macosxTFrzc:deihnr:st:zError: r�rr�rz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-t�-rbrrzeditor-on-startupr)r	�Idle)�	className)�fix_scaling�Icons�Windowszidle.ico)rg333333!@z.png)�� �0�z.gif)r�r�r�z	idle_%d%s)�masterr�IDLESTARTUP�
PYTHONSTARTUPzdif 1:
            import sys as _sys
            _sys.argv = {!r}
            del _sys
            
)I�getoptrTr�rr�r�r0r�r��argv�errorrb�	usage_msgr�exitrr!rPrQr�r�rOr�r�r�r�r�rp�dirnamerv�getcwdrr
�
NoDefaultRootr�r�r��idlelib.runr�rR�__file__�
wm_iconbitmap�isAquaTk�	TkVersion�
PhotoImage�wm_iconphotorr�r�rN�setupAppr�r}�newrO�dictr��lowerrqr3�environrrrr�rVrWr�r��preferTabsPreferenceWarningr��inversedictra�destroy)r�r�r�r��enable_shell�enable_editrt�cmd�script�startup�optsrYr��o�ar-�pathxr&�dir�
edit_startr��icondir�iconfile�ext�sizes�size�	iconfiles�iconsr��prefer_tabs_preference_warnings                              r(rr�s��������T���N��L��K��E�
�C�
�F��G���]�]�3�8�8�A�B�<��@�
��d����1���9��C��L���9��E��L���9��K���9��J�J���Y�'��H�H�J���9��L���9��N��z�z�
#�"�N���9��F��w�w�~�~�f�%���(�&�1����
��L���9��G��L���9�"#�G���L�?�@��Q��3���i�i�n�n�����
�3�s�x�x�=�
!���g�g�o�o�c�h�h�q�k�2������"���Q��3���4�$�q�r�(�?���	��6�D�=���	��8�d�?���	
������H��L�L�������2�3���C��'�'�/�/�#�&�C��#�(�(�?�������3�'��
�i�i�k���c�h�h���H�H�O�O�A�s�#��#�#�F�I�$7�f�F�J��+��K��2�{�?�L��g���
���D��M�M�O�'�����g�g�l�l�2�7�7�?�?�8�4�g�>�G�
�x�9���7�7�<�<���4�����8��,�
�_�_�
�����C�%�E��C� �E�!&�(�!&���W�W�\�\�'�;�$���+D�E�!&�	�(�"+�,�!*�X��4�h�7�!*�	�,����$�'��'��$���$���D�!�E�
�O�O�D�%� ���v� ��G���:�:�h�'�/��K�K��)�$���	�	���� � �"�����?�?�����

�I�I�O�O���
�
��
�
������:�:�>�>�-�0�3��:�:�>�>�/�2�	�������x�0��L�L�!�!�(�+�
�f�
�����!��&����"�		$�
��L�L�#�#�C�(�
��L�L�(�(��0��L�L�!�!�&�)�	�*0�)K�)K�)M�&�)����=�>�
�
�
��
�
���
�
��L�L�N��U���y�<�<��
���u�B�y�k�*����<����������n(��,s#�&[;�,]�6]�;]�
:]
�
])NN)Nr�r�r�rW�ImportErrorrbrfr�rT�idlelib.utilr	r
r�rr�r5rP�os.pathrr}r"r�textwrapr
rGrr�r-�idlelib.colorizerr�idlelib.configr�idlelib.delegatorrrrr�idlelib.editorrr�idlelib.filelistr�idlelib.outwinrrrr�rrr�idlelib.undorr�rr��eofr�r_�	NameErrorr r)r,r0�
checkcacher=r?r�r�r�r��	RPCClientr�r�r�r�r�r�rr�r1r(�<module>rs�����z��%(�[�[��%<�C�K�K�!�"����<�<�7��*��O��'���	��#�	�
�� �����,�#�'���6�%�'���G�G�&�������	�
 �C��D�H��D�H�����>B�
�"��)����+/�2;�2F�2F��(5�	��{"�,�{"�|�h��(
2�^�
2�/�M�/�D1�	�1��#�-�-���k(�0�k(�\
`	,�l�`	,�F;�4
�	�ln�b�z���F�����m4��	�9�?B�~�~�O�
�Q�-����b�	��	�s�F(�!G
�("G
�
G�G

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists