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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/snap/core/current/usr/lib/python3.5/idlelib/__pycache__/
Upload File :
Current File : //snap/core/current/usr/lib/python3.5/idlelib/__pycache__/PyShell.cpython-35.pyc


���f���@s_ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZmZyddlTWn2ek
r�eddej�ejd�YnXddljZddlmZmZdd	lmZdd
lmZddl m!Z!ddl"m#Z#dd
l$m%Z%ddl&m'Z'ddl&m(Z(ddl&m)Z)ddl&m*Z*dZ+dZ,eja-ddl.Z.ddd�Z/dddd�Z0da1dd�Z2e2d�dej3dd�Z4e4e_3Gdd�de�Z5Gdd�de�Z6Gd d!�d!e�Z7Gd"d#�d#e!�Z8Gd$d%�d%e'j9�Z:Gd&d'�d'e
�Z;Gd(d)�d)e#�Z<Gd*d+�d+e
j=�Z>Gd,d-�d-e>�Z?Gd.d/�d/e>�Z@d0d1�ZAd2ZBd3d4�ZCeDd5krQejEd5ejEd)<eC�e2d6�dS)7�N)�InteractiveInterpreter)�python_version�system)�*zJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **�file�)�EditorWindow�
fixwordbreaks)�FileList)�ColorDelegator)�
UndoDelegator)�OutputWindow)�idleConf)�rpc)�Debugger)�RemoteDebugger)�
macosxSupportz	127.0.0.1cCssd}|d||f7}|dkr8tj||�}|j�}|rX|d|7}|d|j|f7}|S)zFormat warnings the IDLE way.z!
Warning (from warnings module):
z  File "%s", line %s
Nz    %s
z%s: %s
)�	linecache�getline�strip�__name__)�message�category�filename�lineno�line�s�r�%/usr/lib/python3.5/idlelib/PyShell.py�idle_formatwarning0srcCsd|dkrt}y3|jt||||d|��|jd�Wnttfk
r_YnXdS)aShow Idle-format warning (after replacing warnings.showwarning).

    The differences are the formatter called, the file=None replacement,
    which can be None, the capture of the consequence AttributeError,
    and the output of a hard-coded prompt.
    Nrz>>> )�warning_stream�writer�AttributeError�OSError)rrrrrrrrr�idle_showwarning=s	r$cCsF|r'tdkrBtjatt_ntdk	rBtt_dadS)z>Replace warning.showwarning with idle_showwarning, or reverse.N)�_warnings_showwarning�warnings�showwarningr$)Zcapturerrr�capture_warningsPs		r(TcCsxtj}i}xKt|�D]=}|dd�|dd�dkr|j|�||<qW||�|j|�dS)aoExtend linecache.checkcache to preserve the <pyshell#...> entries

    Rather than repeating the linecache code, patch it to save the
    <pyshell#...> entries, call the original linecache.checkcache()
    (skipping them), and then restore the saved entries.

    orig_checkcache is bound at definition time to the original
    method, allowing it to be patched.
    Nrz<>���)r�cache�list�pop�update)rZorig_checkcacher*�save�keyrrr�extended_linecache_checkcache_s	$
r0c@s�eZdZdZdd�Zd'd(d)d*d+d,gZddd�Zdd�Zd
dd�Zd
dd�Z	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd
S)-�PyShellEditorWindowz6Regular text edit window in IDLE, supports breakpointscGs�g|_tj||�|jjd|j�|jjd|j�|jjd|jj�t	j
jtj
�d�|_|jj|dd�}|jj|�|jjr�|j�|j�dS)Nz<<set-breakpoint-here>>z<<clear-breakpoint-here>>z<<open-python-shell>>zbreakpoints.lstcSs|j�|�dS)N)�restore_file_breaks)Zold_hook�selfrrr�filename_changed_hook�s
z;PyShellEditorWindow.__init__.<locals>.filename_changed_hook)�breakpointsr�__init__�text�bind�set_breakpoint_here�clear_breakpoint_here�flist�
open_shell�os�path�joinrZ
GetUserCfgDir�breakpointPath�ioZfilename_change_hookZset_filename_change_hookrr2�color_breakpoint_text)r3�argsr4rrrr6ys		
zPyShellEditorWindow.__init__�Cut�<<cut>>�rmenu_check_cut�Copy�<<copy>>�rmenu_check_copy�Paste�	<<paste>>�rmenu_check_pasteN�Set Breakpoint�<<set-breakpoint-here>>�Clear Breakpoint�<<clear-breakpoint-here>>TcCsc|jdkrdS|r:tj�}tj|d�}nddddi}|jjd|�dS)z,Turn colorizing of breakpoint text on or offN�break�
foreground��
background�BREAK)rAr�CurrentTheme�GetHighlightr7Z
tag_config)r3Zcolor�themeZcfgrrrrB�sz)PyShellEditorWindow.color_breakpoint_textcCs�|j}|jj}|jdd|d|d�y|jj|�Wn"tk
rl|jj|�YnXy&|jj	j
j}|j||�WnYnXdS)NrUz%d.0r)
r7rAr�tag_addr5�index�
ValueError�appendr;�pyshell�interp�debuggerr9)r3rr7r�debugrrr�set_breakpoint�s	
z"PyShellEditorWindow.set_breakpointcCsU|j}|jj}|s)|j�dStt|jd���}|j|�dS)N�insert)r7rAr�bell�int�floatrZra)r3�eventr7rrrrrr9�s	
z'PyShellEditorWindow.set_breakpoint_herecCs�|j}|jj}|s)|j�dStt|jd���}y|jj|�WnYnX|j	ddd�y&|j
jjj
}|j||�WnYnXdS)NrbrUzinsert linestartzinsert lineend +1char)r7rArrcrdrerZr5�remove�
tag_remover;r]r^r_r:)r3rfr7rrr`rrrr:�s"	
z)PyShellEditorWindow.clear_breakpoint_herec	Cs�|jr||j}|jj}|s2|j�dSg|_|jddt�y#|jjj	j
}|j|�WnYnXdS)NrUz1.0)r5r7rArrcrhZENDr;r]r^r_�clear_file_breaks)r3r7rr`rrrri�s		
	z%PyShellEditorWindow.clear_file_breaksc Cs[|j}|jj}y,t|jd��}|j�}WdQRXWntk
r[g}YnXy�t|jd��p}x.|D]&}|j|d�s{|j|�q{W|j	�|j}|r�|j|dt
|�d�WdQRXWnotk
rV}zOt|jdd�sDd|j_
tjd	d
ddt
|�d
|j�WYdd}~XnXdS)z#Save breakpoints when file is saved�rN�w�=�
�breakpoint_error_displayedFT�titlez
IDLE Errorrz$Unable to update breakpoint list:
%s�parent)r5rAr�openr@�	readlinesr#�
startswithr!�update_breakpoints�str�getattr�rootrn�tkMessageBox�	showerrorr7)r3Zbreaksr�fp�linesZnew_filer�errrrr�store_file_breaks�s.	


	*
z%PyShellEditorWindow.store_file_breakscCs�|jj�|jdkr dS|jj}|dkr<dStjj|j�r�t|jd��}|j	�}WdQRXx_|D]W}|j
|d�r�t|t|�dd��}x|D]}|j
|�q�Wq�WdS)Nrjrlr)r7r-rArr=r>�isfiler@rqrrrs�eval�lenra)r3rrzr{rZbreakpoint_linenumbersZbreakpoint_linenumberrrrr2s

 
z'PyShellEditorWindow.restore_file_breakscCs4|j}|jd�}|j|�}||_dS)z3Retrieves all the breakpoints in the current windowrUN)r7Z
tag_ranges�ranges_to_linenumbersr5)r3r7�rangesZlinenumber_listrrrrts	z&PyShellEditorWindow.update_breakpointscCs�g}x�tdt|�d�D]f}tt||j��}tt||dj��}x'||kr�|j|�|d7}q^WqW|S)Nr�r)�ranger�rdre�stringr\)r3r�r{rZr�endrrrr�s
z)PyShellEditorWindow.ranges_to_linenumberscCs|j�tj|�dS)z7Extend base method - clear breaks when module is closedN)rir�_close)r3rrrr�-s
zPyShellEditorWindow._close)rDrEzrmenu_check_cut)rGrHrI)rJrKzrmenu_check_paste)NNN)rMrNN)rOrPN)r�
__module__�__qualname__�__doc__r6Zrmenu_specsrBrar9r:rir}r2rtr�r�rrrrr1vs$		*r1c@s1eZdZdZeZdZddd�ZdS)�PyShellFileListz8Extend base class: IDLE supports a shell and breakpointsNcCsN|jr|jjj�n+t|�|_|jrG|jj�sGdS|jS)N)r]�top�wakeup�PyShell�begin)r3rfrrrr<<s		zPyShellFileList.open_shell)rr�r�r�r1rr]r<rrrrr�3sr�c@sFeZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ModifiedColorDelegatorz8Extend base class: colorizer for the shell window itselfcCstj|�|j�dS)N)rr6�LoadTagDefs)r3rrrr6Js
zModifiedColorDelegator.__init__cCs7|jddd�|jddd�tj|�dS)NZTODOz1.0�iomarkZSYNC)rhrYr�recolorize_main)r3rrrr�Nsz&ModifiedColorDelegator.recolorize_maincCsutj|�tj�}|jjdddddidtj|d�dtj|d�dtj|d�i�dS)N�stdinrTrR�stdout�stderr�console)rr�rrV�tagdefsr-rW)r3rXrrrr�Ss
	z"ModifiedColorDelegator.LoadTagDefscCs+x$|jD]}|j|dd�q
WdS)Nr�r�)r�rh)r3�tagrrr�removecolors]sz#ModifiedColorDelegator.removecolorsN)rr�r�r�r6r�r�r�rrrrr�Gs

r�c@s4eZdZdZddd�Zddd�ZdS)�ModifiedUndoDelegatorz;Extend base class: forbid insert/delete before the I/O markNc
Cs\y-|jj|dd�r,|jj�dSWntk
rAYnXtj||||�dS)N�<r�)�delegate�comparerc�TclErrorrrb)r3rZ�chars�tagsrrrrbes

zModifiedUndoDelegator.insertcCsYy-|jj|dd�r,|jj�dSWntk
rAYnXtj|||�dS)Nr�r�)r�r�rcr�r�delete)r3Zindex1Zindex2rrrr�ns

zModifiedUndoDelegator.delete)rr�r�r�rbr�rrrrr�bs	r�c@seZdZdd�ZdS)�MyRPCClientcCs
t�dS)z0Override the base class - just re-raise EOFErrorN)�EOFError)r3rrr�
handle_EOFzszMyRPCClient.handle_EOFN)rr�r�r�rrrrr�xsr�c@s�eZdZdd�ZdZdZdZdd�Zdd�Zdd	�Z	d
ddd
�Z
dd�Zdd�Zdd�Z
dd�Zd
dd�ZdZdd�ZdZdd�Zdd�Zdd�Zd d!�Zd"Zd#d$�Zdd%d&�Zd'd(�Zd)d*�Zd+d,�Zdd-d.�Zd/d0�Zd1d2�Zd3d4�Z d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%dS)?�ModifiedInterpretercCsf||_tjdj}tj|d|�d|_d|_d|_t	|_
|jjj
|_dS)N�__main__�localsF)�	tkconsole�sys�modules�__dict__rr6�save_warnings_filters�
restarting�subprocess_arglist�PORT�port�compile�compiler�flags�original_compiler_flags)r3r�r�rrrr6�s					zModifiedInterpreter.__init__NcCs7|jdkr|j�|_tj|j�|_dS)N)r��build_subprocess_arglist�
subprocess�Popen�
rpcsubproc)r3rrr�spawn_subprocess�sz$ModifiedInterpreter.spawn_subprocesscCs�|jdkstd��dd�tjD�}tjddddd	d
d�}tdkrnd
|f}n
d|f}tjg|d|t|j�gS)Nrz/Socket should have been assigned a port number.cSsg|]}d|�qS)z-Wr)�.0rrrr�
<listcomp>�s	z@ModifiedInterpreter.build_subprocess_arglist.<locals>.<listcomp>�main�Generalzdelete-exitfunc�defaultF�type�boolzidlelib.PyShellz&__import__('idlelib.run').run.main(%r)z__import__('run').main(%r)z-c)	r��AssertionErrorr��warnoptionsr�	GetOptionr�
executableru)r3rkZ	del_exitfZcommandrrrr��s	
z,ModifiedInterpreter.build_subprocess_arglistcCs�t|jf}xXtd�D]<}tj|�yt|�|_PWqtk
rWYqXqW|j�dS|jj	j
�d|_tdkr�|jj	jt
jt
jd�|j�|jj	jd�y|jj�Wn#t
jk
r|j�dSYnX|jjd|j�|jjd|jj�|jjd|jj�|jjd|jj�|jjd	|jj�|jjd
t�|jjd|�|jdd
�|j�|jS)N�rr�
r�r�r�r�r;rr^�with_cwdT)�HOSTr�r��timeZsleepr��rpccltr#�display_port_binding_error�listening_sockZgetsocknamer�Z
setsockopt�socketZ
SOL_SOCKETZSO_REUSEADDRr�Z
settimeout�accept�timeout�display_no_subprocess_error�registerr�r�r�r�r;r�
transfer_path�poll_subprocess)r3Zaddr�irrr�start_subprocess�s>

	



	
z$ModifiedInterpreter.start_subprocessFrScCs�|jr|jSd|_|j�}|rJytj|j�WnYnX|jj�|j�|j}|j}d|_|j	�y|jj
�Wn#tjk
r�|j
�dSYnX|jd|�|j�|jjdd�d|r�|nd}t|j�t|�dd	d
}|jdj||��|jjdd�|jjdd
�|st|j�|r�tj|j�|j�|j|jj_d|_|jS)NTFr�r�zend-1cz	RESTART: ZShell�r�rlz
{0} {1} {0}�restart�left) r�r��getdebuggerrZclose_subprocess_debugger�close�terminate_subprocessr��	executingr�r�r�r�r�r��
stop_readliner7r�rd�widthr�r!�format�mark_set�mark_gravity�
showpromptZrestart_subprocess_debugger�load_breakpointsr�r�r�r�)r3r�rr`r�Z
was_executingr�Zhalfbarrrr�restart_subprocess�sH		

			

	
%

	z&ModifiedInterpreter.restart_subprocesscCs|jjddfi�dS)N�execZinterrupt_the_server)r�Z
remotecall)r3rrrZ__request_interrupt�sz'ModifiedInterpreter.__request_interruptcCstjd|j�j�dS)N�target)�	threadingZThread�'_ModifiedInterpreter__request_interrupt�start)r3rrr�interrupt_subprocess�sz(ModifiedInterpreter.interrupt_subprocesscCs�|jdk	r%|jjj|j�y|jjj�Wntk
rMYnXy|jj�Wntk
rsYnX|j�d|j_	d|_dS)NF)
�_afteridr�r7Zafter_cancelr�r�r�r"r�r�)r3rrr�kill_subprocesss


z#ModifiedInterpreter.kill_subprocesscCsXy|jj�Wntk
r)dSYn+Xy|jj�Wntk
rSdSYnXdS)z"Make sure subprocess is terminatedN)r��killr#�wait)r3rrrr�s
	
z(ModifiedInterpreter.terminate_subprocesscCsC|r"dg}|jtj�n	tj}|jd|f�dS)NrSzRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
)�extendr�r>�
runcommand)r3r�r>rrrr�s		z!ModifiedInterpreter.transfer_pathcCs�|j}|dkrdSy|j|jdd�}Wn;tttfk
rr|jjr^dSd}|j�YnX|rd|jj	�d|_|\}}|jj
}|dkr�|dk	r>tt|�d|�nf|dkr|jj
d�r>|j�n;|dkr>d}t||dtj�t||d|�y|jj�Wntk
rcYnX|jjs�|jjj|jj|j�|_dS)	Nr�g�������?ZOKrZ	EXCEPTIONz<<toggle-jit-stack-viewer>>�ERRORz/PyShell.ModifiedInterpreter: Subprocess ERROR:
)r�Zpollresponse�
active_seqr�r#�KeyboardInterruptr��closingr��resetoutputr��print�repr�getvar�remote_stack_viewerr��
__stderr__�endexecutingr"r7�after�pollintervalr�r�)r3Zclt�responseZhowZwhatr��errmsgrrrr�,s@	
	

z#ModifiedInterpreter.poll_subprocesscCs
||_dS)N)r_)r3r_rrr�setdebuggerTszModifiedInterpreter.setdebuggercCs|jS)N)r_)r3rrrr�WszModifiedInterpreter.getdebuggercCs|jjjd|j�dS)a�Initiate the remote stack viewer from a separate thread.

        This method is called from the subprocess, and by returning from this
        method we allow the subprocess to unblock.  After a bit the shell
        requests the subprocess to open the remote stack viewer which returns a
        static object looking at the last exception.  It is queried through
        the RPC mechanism.

        i,N)r�r7r�r�)r3rrr�open_remote_stack_viewerZs
z,ModifiedInterpreter.open_remote_stack_viewercCs�ddlm}|jjdddi�}|dkrK|jjj�dS|j|j|�}ddlm	}m
}t|jj�}tj
�}tj|d�d}||d	|d
d�}	|	jjddd
d�||	jd|�}
|
j�dS)Nr)�RemoteObjectBrowserr�Zstackviewerr;)�ScrolledCanvas�TreeNodeZnormalrTZbgZhighlightthickness�expandrZfillZboth)zflist)�idlelibrr��remotequeuer�rwrcZStubObjectTreeItemZidlelib.TreeWidgetrrZToplevelrrVrW�frameZpackZcanvasr)r3rZoid�itemrrr�rXrTZscZnoderrrr�gsz'ModifiedInterpreter.remote_stack_viewerrcCs#|j|�}|j||�dS)z1Like runsource() but assumes complete exec sourceN)�stuffsource�execfile)r3�sourcerrrr�
execsourcezszModifiedInterpreter.execsourcecCs�|dkr1tj|��}|j�}WdQRXyt||d�}WnXttfk
r�|jj�tdd|jj	�t
j||�|jj�YnX|j
|�dS)zExecute an existing fileNr�zB*** Error in script or command!
Traceback (most recent call last):r)�tokenizerq�readr��
OverflowError�SyntaxErrorr�r�r�r�r�showsyntaxerrorr��runcode)r3rr
rz�coderrrrs
	
zModifiedInterpreter.execfilec
Cs�|j|�}d|_tjdd�|_tjdddt�t|t�sYt	�zt
j|||�SWd|jdk	r�|jtjdd�<d|_XdS)zBExtend base class method: Stuff the source in the line cache firstrN�action�errorr)rZmorer&�filtersr��filterwarnings�
SyntaxWarning�
isinstancerur�r�	runsource)r3r
rrrrr�s		zModifiedInterpreter.runsourcecCsSd|j}|jd|_|jd�}t|�dd||ftj|<|S)z"Stuff source in the filename cachez<pyshell#%d>rrmr)�gid�splitr�rr*)r3r
rr{rrrr�s

#zModifiedInterpreter.stuffsourcecCs|jd|f�dS)z>Prepend sys.path with file's directory if not already includeda(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
            
N)r�)r3rrrr�prepend_syspath�sz#ModifiedInterpreter.prepend_syspathcCs|j}|j}|jddd�tj�\}}}t|dd�pU|pUd}t|dd�pmd}t|d	d�p�d
}	|	d
kr�|d7}|dkr�d|	d}
nd|d|	df}
|j||
�|j�|jd
|�|j	�dS)z�Override Interactive Interpreter method: Use Colorizing

        Color the offending position instead of printing it and pointing at it
        with a caret.

        r�z1.0r��msgrSz<no detail available>rr�offsetrziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
N)
r�r7rhr��exc_inforvZcolorize_syntax_errorr�r!r�)r3rr�r7r��value�tbr rr!�posrrrr�s"		

z#ModifiedInterpreter.showsyntaxerrorcCsG|jj�|j�tj|�|jjd�rC|jj�dS)z1Extend base class method to reset output properlyz<<toggle-jit-stack-viewer>>N)r�r��checklinecacher�
showtracebackr��open_stack_viewer)r3rrrr'�s



z!ModifiedInterpreter.showtracebackcCsUtj}xEt|j��D]1}|dd�|dd�dkr||=qWdS)Nrz<>r))rr*r+�keys)r3�cr/rrrr&�s	$z"ModifiedInterpreter.checklinecachecCsV|jjr|j�dS|jrB|jjdd|fi�nt||j�dS)z*Run the code without invoking the debuggerrr�rr)r�r��display_executing_dialogr�rr�r�)r3rrrrr��s
	zModifiedInterpreter.runcommandcCs�|jjr|jj�|j�|jdk	rQ|jtjdd�<d|_|j}zNyw|jj	�|r�|j
dk	r�|j
jdd|fi�|_n,|r�|j
||j�nt||j�Wn�tk
r.|jjs'tjddddd|jj�r�q*|j�n�Ynytrgtd	d
|jj�|j�|jj�n;|jjr�d|j_tdd
|jj�n
|j�YnXWdts�y|jj�Wntk
r�YnXXdS)
zOverride base class methodNr�rzExit?zDo you want to exit altogether?r�Zyesrpz IDLE internal error in runcode()rFr�)r�r�r^r�r&r�r&rr_�beginexecutingr�Z
asyncqueuer�Zrunr�r��
SystemExitr�rxZaskyesnor7r'�use_subprocessr�r�r��canceledr")r3rr_rrrr�sP

		


	


zModifiedInterpreter.runcodecCs|jjj|�S)zOverride base class method)r�r�r!)r3rrrrr!"szModifiedInterpreter.writecCs tjddd|jj�dS)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.rp)rxryr�r7)r3rrrr�&sz.ModifiedInterpreter.display_port_binding_errorcCs tjddd|jj�dS)NzSubprocess Startup Errorz�IDLE's subprocess didn't make connection.  Either IDLE can't start a subprocess or personal firewall software is blocking the connection.rp)rxryr�r7)r3rrrr�1sz/ModifiedInterpreter.display_no_subprocess_errorcCs tjddd|jj�dS)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.rp)rxryr�r7)r3rrrr+9sz,ModifiedInterpreter.display_executing_dialog)&rr�r�r6r�r�r�r�r�r�r�r�r�r�r�r�r�r�r_rr�rr�rrrrrrrr'r&r�rr!r�r�r+rrrrr�sF
+-

&
1r�cs/eZdZde�dZeZeZdVdWdXdYdZd[gZ	ddl
mZddd�Zdd�Z
dZdZdZdZdZdZdd�Zdd�Zddd�Zdd�Zddd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1Z!d2d3�Z"d4d5�Z#d6d7�Z$d8d9�Z%dd:d;�Z&d<d=�Z'd>d?�Z(d@dA�Z)dBdC�Z*dDdE�Z+ddFdG�Z,ddHdI�Z-ddJdK�Z.dLdM�Z/dNdO�Z0fdPdQ�Z1�fdRdS�Z2�fdTdU�Z3�S)\r�zPython z Shellr�_File�edit�_Editr`�_Debug�options�_Options�windows�_Window�help�_Helpr)�HistoryNc	Cs�tr3|j}|dddkr3|jdd�t|�|_|dkrwt�}t|�|j�t|�}t	j
||dd�d|_d|_d|_
|j}|jdd�|jd	|j�|jd
|j�|jd|j�|jd|j�|jd
|j�|jd|j�|jd|j�trr|jd|j�|jd|j�tj|_tj|_tj|_ ddl!m"}t#|d|j$�|_t%|d|j$�|_t%|d|j$�|_t%|d|j$�|_&ts0|jt_|jt_|jt_yddl'}|j(|_)Wntj*t_�YnX|j+|j�|_,d|_-dS)Nr�r�shell�She_llT�Zwrap�charz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>>z<<toggle-debugger>>z<<toggle-jit-stack-viewer>>z<<view-restart>>z<<restart-shell>>)�	IOBindingr�r�r�r��2)zshellr<).r.�
menu_specsrbr�r^�Tkr	�withdrawr�r
r6ZusetabsZindentwidthZcontext_use_ps1r7Z	configurer8�enter_callback�linefeed_callback�cancel_callback�eof_callbackr(�toggle_debugger�toggle_jit_stack_viewer�view_restart_mark�
restart_shellr�r��save_stdoutr��save_stderrr��
save_stdinrr?�PseudoInputFile�encoding�PseudoOutputFiler��pydocZ
plainpagerZpagerr�r:�historyr�)r3r;Zmsrwr7r?rRrrrr6Ws\		

				zPyShell.__init__cCstjdd�S)NZ
shell_onlyT)rZ
GetExtensions)r3rrr�get_standard_extension_names�sz$PyShell.get_standard_extension_namesFcCs
|adS)N)r )r3�streamrrr�set_warning_stream�szPyShell.set_warning_streamcCstS)N)r )r3rrr�get_warning_stream�szPyShell.get_warning_streamcCs`|jr0tjddd|j�|j�dS|jj�}|rR|j�n
|j�dS)NzDon't debug nowz*You can only toggle the debugger when idlerprQ)	r�rxryr7�set_debugger_indicatorr^r��close_debugger�
open_debugger)r3rf�dbrrrrH�s		


zPyShell.toggle_debuggercCs%|jj�}|jd|�dS)Nz<<toggle-debugger>>)r^r�Zsetvar)r3r[rrrrX�szPyShell.set_debugger_indicatorcCsdS)Nr)r3rfrrrrI�szPyShell.toggle_jit_stack_viewercCs�|jj�}|r{|jjd�|j�|jjrNtj|jj�|j�|jj	d�dt
_|j�|j
�dS)Nz[DEBUG OFF]
z>>> )r^r�rr�r�rZclose_remote_debuggerr�r�r!r��ps1r�rX)r3r[rrrrY�s

	
zPyShell.close_debuggercCsq|jjr'tj|jj|�}ntj|�}|jj|�|j�dt_|j	�|j
�dS)Nz[DEBUG ON]
>>> )r^r�rZstart_remote_debuggerrrr�r�r\r�rX)r3Zdbg_guirrrrZ�s
	
zPyShell.open_debuggercCs|j�d|_dS)zHelper for ModifiedInterpreterrN)r�r�)r3rrrr,�s
zPyShell.beginexecutingcCs d|_d|_|j�dS)zHelper for ModifiedInterpreterrN)r�r/r�)r3rrrr��s		zPyShell.endexecutingcCsc|jr:tjddddd|j�}|dkr:dS|j�d|_d|_tj|�S)	zExtend EditorWindow.close()zKill?z7Your program is still running!
 Do you want to kill it?r��okrpFZcancelT)	r�rxZaskokcancelr7r�r/r�rr�)r3r�rrrr��s	
		z
PyShell.closecCsy|j�tr|jj�|jt_|jt_|j	t_
d|_d|_d|j_
d|_tj|�dS)zEExtend EditorWindow._close(), shut down debugger and execution serverN)rYr.r^r�rLr�r�rMr�rNr�r�r;r]rSrr�)r3rrrr��s

			zPyShell._closecCsdS)z8Override EditorWindow method: never remove the colorizerTr)r3rrrr�ispythonsource�szPyShell.ispythonsourcecCs|jS)N)�shell_title)r3rrr�short_title�szPyShell.short_titlez@Type "copyright", "credits" or "license()" for more information.cCs�|jjdd�|j�trOd}|jj�}|sm|j�dSndddd}tjt	_|j
d	t	jt	j|j
|f�|jj�|j�d
dl}d|_dS)Nr�rbrSFz==== No Subprocess ====

z9WARNING: Running IDLE without a Subprocess is deprecated
z;and will be removed in a later version. See Help/IDLE Help
zfor details.

zPython %s on %s
%s
%srT)r7r�r�r.r^r�r�r�displayhookr�r!�version�platform�	COPYRIGHTZfocus_forcer��tkinterZ
_default_root)r3ZnosubZclientrerrrr�s$

	

	z
PyShell.begincCs'|js
dSd|_|jj�dS)NT)�reading�_stop_readline_flagr��quit)r3rrrr�s		zPyShell.stop_readlinecCs�|j}zd|_|jj�Wd||_X|jrFd|_dS|jjdd�}t|�dkrsd}|j�|jr�d|_t	s�t
�|jr�d|_d}|S)NrFrSr�zend-1crrm)rfr��mainlooprgr7�getr�r�r/r.r��	endoffile)r3r.rrrr�readline"s(		
		
				zPyShell.readlinecCsdS)NTr)r3rrr�isatty9szPyShell.isattyc
Cs�y |jjddd�rdSWnYnX|jp:|jse|j�|jjd�|j�dSd|_d|_	|jr�|jj
r�|jj�r�|jj�n
|jj
�|jr�|jj�dS)Nz	sel.firstz!=zsel.lastzKeyboardInterrupt
rQrr)r7r�r�rfr�r^r!r�rkr/r�r�r�r�r�rh)r3rfrrrrF<s&

		
	
zPyShell.cancel_callbackcCs�|jr|jrdS|jjddd�oD|jjddd�sKdS|jsk|j�|j�nd|_d|_|jj	�dS)Nr�z==rbzend-1crrrQ)
r�rfr7r�r�r�r/rkr�rh)r3rfrrrrGRs	

		
zPyShell.eof_callbackcCs@|jr/|jjdd�|jjd�n
|j|�dS)NrbrmrQ)rfr7rb�see�newline_and_indent_event)r3rfrrrrEas
	
zPyShell.linefeed_callbackcCs�|jr|jrdSyK|jjdd�}|ra|jjddd�ra|j||�dSWnYnX|jjddd�r�|jjd	d�}|r�|jjdd|d
�r�|j|jj|d|d
�|�dS|jjd	d�}|rI|jjdd
|d�rI|j|jj|d|d
�|�dS|jjdd�}|r�|jj|ddd�r�|j|jj|d
d�|�n|j|jjdd�|�dS|jjddd�r�|jjdd�|jjdd�}|r/|j	�r/|jj
dd�|jjddd�rX|j|�dS|jjdd�|jr�|jjdd�|jj
d�n
|j|�|jjd	dd�|jj�|jr�|jj�n
|j�dS)Nz	sel.firstzsel.lastz<=r�rQrbr�ziomark linestartr�rrzinsert lineendz>=r�zinsert linestartzend-1czend-1c linestartrm)r�rfr7rjr��recallZ
tag_prevrangeZ
tag_nextranger�rr�rorbrnrYZupdate_idletasksr�rh�runit)r3rf�sel�prev�next�indicesrrrrrDjsX"'"'&
	

	
zPyShell.enter_callbackcCs�tjdd|�}tjdd|�}|jd�}|jj�zC|jjddd�|jjdd	�|jjd
d�}|j�j	d�r�|j
|�|jjd
d�}|jjd|dj��t
|�d
kr�tjd|d�jd�}tjd|�jd�}x^|d
d�D]L}|j|�rg||t
|�d�}|jjdd|j��q8WWd|jjd�|jj�XdS)Nz^\s*\nrSz\n\s*$rmrrz1.0r�rbzend-1czinsert linestart�:rrz	^([ \t]*))�re�subrr7Zundo_block_startrhr�rj�rstrip�endswithrorbrr��search�grouprsrnZundo_block_stop)r3rrfr{�prefixZorig_base_indentZnew_base_indentrrrrrp�s*

%zPyShell.recallcCs�|jjdd�}t|�}x.|dkrQ||ddkrQ|d}q$W|dkr|||ddkr||d}x.|dkr�||ddkr�|d}qW|d|�}|jj|�dS)Nr�zend-1crrz 	rm)r7rjr�r^r)r3rr�rrrrq�s# 
#z
PyShell.runitcCss|jjr|jj�SytjWn%tjddd|j�dSYnXddlm	}||j
|j�dS)NzNo stack tracez@There is no stack trace yet.
(sys.last_traceback is not defined)rpr)�StackBrowser)r^r�r�r��last_tracebackrxryr7Zidlelib.StackViewerr~rwr;)r3rfr~rrrr(�s
	
	zPyShell.open_stack_viewercCs$|jjd�|jjd�dS)Nr�r�)r7rn)r3rfrrrrJ�szPyShell.view_restart_markcCs|jjdd�dS)z&Callback for Run/Restart Shell Cntl-F6r�TN)r^r�)r3rfrrrrK�szPyShell.restart_shellc	Csl|j�yttj�}Wnd}YnX|jj|�|jjdd�|j�|j	j
�dS)NrSrbzend-1c)r�rur�r\r�r!r7r��set_line_and_columnrAZ
reset_undo)r3rrrrr��s

zPyShell.showpromptcCsz|jjdd�}|jr.|jj|�|jjd�dkrY|jjdd�|jjdd�|j�dS)Nr�zend-1czend-2crm)r7rjrSZstorerbr�r�)r3r
rrrr��s	zPyShell.resetoutputcCs�t|t�rst|�rst|�dkrsx't|�D]\}}|dkr:Pq:Wtd|||dd��yB|jjdd�tj	|||d�}|jjdd�Wn�YnX|j
r�d|_
ts�t�|S)	Nu￿zUCS-2rz%Non-BMP character not supported in Tkr��rightr�r)
rrur��max�	enumerate�UnicodeEncodeErrorr7r�r
r!r/r.r�)r3rr�r�r>�countrrrr!�s"-			z
PyShell.writecsFy |jjddd�rdSWntk
r8dSYnXt�j�S)Nz	sel.firstr�r��disabled)r7r�r��superrF)r3)�	__class__rrrFs
	zPyShell.rmenu_check_cutcs)|jjddd�rdSt�j�S)Nrbr�r�r�)r7r�r�rL)r3)r�rrrLszPyShell.rmenu_check_paste)zfiler0)r1r2)zdebugr3)r4r5)r6r7)zhelpr9)4rr�r�rr_r�rr�rrAZidlelib.IdleHistoryr:r6rTrfr�r/rkr�rgrVrWrHrXrIrYrZr,r�r�r�r^r`rdr�r�rlrmrFrGrErDrprqr(rJrKr�r�r!rFrLrr)r�rr�Asd	:
	?	r�c@sOeZdZddd�Zedd��Zedd��Zdd	�ZdS)
�
PseudoFileNcCs||_||_||_dS)N)r;r��	_encoding)r3r;r�rPrrrr6"s		zPseudoFile.__init__cCs|jS)N)r�)r3rrrrP'szPseudoFile.encodingcCsd|jS)Nz<%s>)r�)r3rrr�name+szPseudoFile.namecCsdS)NTr)r3rrrrm/szPseudoFile.isatty)rr�r�r6�propertyrPr�rmrrrrr� sr�c@s(eZdZdd�Zdd�ZdS)rQcCsdS)NTr)r3rrr�writable5szPseudoOutputFile.writablecCst|jrtd��t|�tk	r^t|t�sOtdt|�j��tj|�}|jj	||j
�S)Nzwrite to closed filezmust be str, not )�closedr[r�rur�	TypeErrorr�__str__r;r!r�)r3rrrrr!8s	zPseudoOutputFile.writeN)rr�r�r�r!rrrrrQ3srQc@sUeZdZddd�Zdd�Zd
dd�Zdd	d
�Zdd�ZdS)rONcCs#tj||||�d|_dS)NrS)r�r6�_line_buffer)r3r;r�rPrrrr6EszPseudoInputFile.__init__cCsdS)NTr)r3rrr�readableIszPseudoInputFile.readablercCs�|jrtd��|dkr*d}n(t|t�sRtdt|�j��|j}d|_|dkr�x�|jj	�}|s�P||7}qsWn\x6t
|�|kr�|jj	�}|s�P||7}q�W||d�|_|d|�}|S)Nzread from closed filerzmust be int, not rSrr))r�r[rrdr�r�rr�r;rlr�)r3�size�resultrrrrrLs,				zPseudoInputFile.readcCs�|jrtd��|dkr*d}n(t|t�sRtdt|�j��|jpg|jj	�}|dkr�t
|�}|jdd|�}|dkr�|d}||d�|_|d|�S)Nzread from closed filerzmust be int, not rrmr))r�r[rrdr�r�rr�r;rlr��find)r3r�rZeolrrrrlcs		
zPseudoInputFile.readlinecCs|jj�dS)N)r;r�)r3rrrr�sszPseudoInputFile.closer)r))rr�r�r6r�rrlr�rrrrrOCs
rOcCsG|jdkrCx1dD])}|j|dd|j|d��qWdS)	z6Make paste replace selection on x11.  See issue #5124.Zx11�Text�Entry�Spinboxz	<<Paste>>z%catch {%W delete sel.first sel.last}
N)r�r�r�)Z_windowingsystemZ
bind_class)rw�clsrrr�
fix_x11_pastews
r�a�
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].
cs�td�dad}d}d}d}d}d}y)tjtjdd�d�\}}WnRtjk
r�}z/td|tfdtj�tj	d�WYdd}~XnXx*|D]"\}	}
|	dkr�|
}d}|	d	kr�d}d}|	d
krd}|	dkr-tj
jt�tj	�|	dkr?d}|	d
krdtddtj�da|	dkr�|
}tj
j|�r�ntd|�tj	�d}|	dkr�d}d}|	dkr�|
t_d}q�W|r
|ddkr
tjj�}d}x=tttj
��D]&}tj
jtj
|�tj
|<q W|r}|ddkr}dg|dd�t_n�|r�dg|t_n�|r�|g|t_n�|r3d}g}x'|D]}
|jtj
j|
��q�Wxs|D]:}tj
j|�}|tj
kr�tj
jd|�q�Wn.tj�}|tj
kratj
jd|�tjddddd�}|p�|}|p�|}tdd�atj�tj
jtj
jt �d��t!�dkrtj
j�d�}tj"d |�nct#d!krit#d"kr$d#nd$���fd%d&�d3D�}d*d&�|D�}tj$d|�t%t�t&t�t't�a(t)j*tt(�t)j+�r�tj,d+d,�tj,d+d-�tj,d+d.�|r4|p�|s4x:|dd�D](}
t(j-|
�dkr�|j.|
�q�W|s4t(j/�|rut(j0�}|sPdSt)j+�r~t(j1r~|j2j3�n	t(j4}|r�|j5�|r�tj6j7d/�p�tj6j7d0�}
|
r�tj
j|
�r�|j8j9|
�|s�|rH|j8j:d1tjf�|r|j8j;|�qw|rw|j8j<|�|j8j9|�n/|rwt)j=t�}|rw|j8j:d2|�xt(j>r�tj?�qzWtj@�td�dS)4NTFrzc:deihnr:st:zError: %s
%srr�z-cz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-tr�-rSr�r�zeditor-on-startupr�r�Z	classNameZIdleZIconsZWindowszidle.icor�g!@g333333!@z.pngz.gifcs/g|]%}tjj�d|�f��qS)z	idle_%d%s)r=r>r?)r�r�)�ext�icondirrrr�s	zmain.<locals>.<listcomp>�� �0cSsg|]}td|��qS)r)Z
PhotoImage)r��iconfilerrrr�s	r�z<B2>z<B2-Motion>z<<PasteSelection>>ZIDLESTARTUPZ
PYTHONSTARTUPzbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
zprint('%s'))r�r�r�)Ar(r.�getoptr��argvrr��	usage_msgr��exitr�r!r=r>r~r�r_r�rr�r��abspathr\�dirnamerb�getcwdrr�rBrwrCr?�__file__rZ
wm_iconbitmapZ	TkVersionZwm_iconphotor	r�r�r;rZsetupAppZisAquaTkZunbind_classrqrg�newr<�dictr��lowerr]rZ�environrjr^rr�rrZtkVersionWarningZinversedictriZdestroy)Zenable_shellZenable_editr`�cmdZscriptZstartupZoptsrCr �o�ar�Zpathxr�dirZ
edit_startr�Z	iconfilesZiconsr;Ztkversionwarningr)r�r�rr��s
) 
	


	
$



!



	
	
r�r�F)Fr�r=�os.pathrwr�r�r�r�r�rrArrrrcrrre�ImportErrorr�r�r�Ztkinter.messageboxZ
messageboxrxZidlelib.EditorWindowrr	Zidlelib.FileListr
Zidlelib.ColorDelegatorrZidlelib.UndoDelegatorrZidlelib.OutputWindowr
Zidlelib.configHandlerrrrrrrr�r�r r&rr$r%r(�
checkcacher0r1r�r�r�Z	RPCClientr�r�r��
TextIOBaser�rQrOr�r�r�rr�rrrr�<module>sz
	
	
	�����4?�