ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/self/root/opt/alt/python27/lib64/python2.7/idlelib/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/self/root/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyo

�
�[
bc@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZmZyddlTWn1ek
r�eddej�ejd�nXddlZdd	lmZmZdd
lmZddlmZddlm Z dd
l!m"Z"ddl#m$Z$ddl%m&Z&ddl%m'Z'ddl%m(Z(ddl%m)Z)ddl%m*Z*ej+ej,dZ-dZ.dZ/yddl0m1Z1Wnek
rdZ1nXeja2ddl3Z3e4d�Z5e4e4d�Z6e4a7d�Z8e8e9�e4ej:d�Z;e;e_:defd��YZ<defd ��YZ=d!efd"��YZ>d#e fd$��YZ?d%e&j@fd&��YZAd'efd(��YZBd)e"fd*��YZCd+ejDfd,��YZEd-eEfd.��YZFd/eEfd0��YZGd1�ZHd2ZId3�ZJeKd4kr�ejLd4ejLd)<eJ�ne8eM�dS(5i����(tprint_functionN(tInteractiveInterpreter(tpython_versiontsystem(t*sJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **tfilei(tEditorWindowt
fixwordbreaks(tFileList(tColorDelegator(t
UndoDelegator(tOutputWindow(tidleConf(trpc(tDebugger(tRemoteDebugger(t
macosxSupport(t	IOBindingt_s	127.0.0.1i(tSIGTERMicCsyd}|d||f7}|dkr;tj||�}n|j�}|r^|d|7}n|d|j|f7}|S(sFormat warnings the IDLE way.s!
Warning (from warnings module):
s  File "%s", line %s
s    %s
s%s: %s
N(tNonet	linecachetgetlinetstript__name__(tmessagetcategorytfilenametlinenotlinets((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytidle_formatwarning7scCsf|dkrt}ny3|jt||||d|��|jd�Wnttfk
ranXdS(sShow 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.
    Rs>>> N(Rtwarning_streamtwriteRtAttributeErrortIOError(RRRRRR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytidle_showwarningDs		cCsL|r*tdkrHtjatt_qHntdk	rHtt_dandS(s>Replace warning.showwarning with idle_showwarning, or reverse.N(t_warnings_showwarningRtwarningstshowwarningR$(tcapture((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytcapture_warningsWs		cCsotj}i}xBt|�D]4}|d |ddkr|j|�||<qqW||�|j|�dS(soExtend 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.
    ii����s<>N(Rtcachetlisttpoptupdate(Rtorig_checkcacheR*tsavetkey((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytextended_linecache_checkcachefs	
tPyShellEditorWindowcBs�eZdZd�ZdddddgZed�Zd�Zdd�Z	dd�Z
d�Zd�Zd�Z
d�Zd�Zd�ZRS(s6Regular text edit window in IDLE, supports breakpointscGs�g|_tj||�|jjd|j�|jjd|j�|jjd|jj�t	j
jtj
�d�|_|jj|d�}|jj|�|jjr�|j�n|j�dS(Ns<<set-breakpoint-here>>s<<clear-breakpoint-here>>s<<open-python-shell>>sbreakpoints.lstcSs|j�|�dS(N(trestore_file_breaks(told_hooktself((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytfilename_changed_hook�s
(tbreakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt
open_shelltostpathtjoinRt
GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR3tcolor_breakpoint_text(R5targsR6((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8�s		
tCuts<<cut>>trmenu_check_cuttCopys<<copy>>trmenu_check_copytPastes	<<paste>>trmenu_check_pastesSet Breakpoints<<set-breakpoint-here>>sClear Breakpoints<<clear-breakpoint-here>>cCse|jdkrdS|r:tj�}tj|d�}nidd6dd6}|jjd|�dS(s,Turn colorizing of breakpoint text on or offNtbreaktt
foregroundt
backgroundtBREAK(RDRRtCurrentThemetGetHighlightR9t
tag_config(R5tcolortthemetcfg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRG�scCs�|j}|jj}|jdd|d|d�y|jj|�Wn!tk
rk|jj|�nXy&|jj	j
j}|j||�WnnXdS(NRSs%d.0i(
R9RDRttag_addR7tindext
ValueErrortappendR=tpyshelltinterptdebuggerR;(R5RR9Rtdebug((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytset_breakpoint�s	
cCsU|j}|jj}|s)|j�dStt|jd���}|j|�dS(Ntinsert(R9RDRtbelltinttfloatR[Rb(R5teventR9RR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR;�s	
cCs�|j}|jj}|s)|j�dStt|jd���}y|jj|�WnnX|j	ddd�y&|j
jjj
}|j||�WnnXdS(NRcRSsinsert linestartsinsert lineend +1char(R9RDRRdReRfR[R7tremovet
tag_removeR=R^R_R`R<(R5RgR9RRRa((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR<�s"	
cCs�|jr~|j}|jj}|s2|j�dSg|_|jddt�y#|jjj	j
}|j|�Wq~q~XndS(NRSs1.0(R7R9RDRRdRitENDR=R^R_R`tclear_file_breaks(R5R9RRa((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRk�s		
	c	CsO|j}|jj}y+t|jd��}|j�}WdQXWntk
rYg}nXy�t|jd��v}x1|D])}|j|d�sy|j|�qyqyW|j	�|j}|r�|j|dt
|�d�nWdQXWn`tk
rJ}t|jdt
�sKt|j_tjddd	d
t
|�d|j�qKnXdS(s#Save breakpoints when file is savedtrNtwt=s
tbreakpoint_error_displayedttitles
IDLE ErrorRs$Unable to update breakpoint list:
%stparent(R7RDRtopenRCt	readlinesR#t
startswithR!tupdate_breakpointststrtgetattrtroottFalsetTrueRottkMessageBoxt	showerrorR9(R5tbreaksRtold_filetlinestnew_fileRterr((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytstore_file_breaks�s.	



	,
cCs�|jj�|jdkr dS|jj}|dkr<dStjj|j�r�t	|jd�j
�}x_|D]T}|j|d�rpt|t
|�d�}x|D]}|j|�q�WqpqpWndS(NRlRni(R9R-RDRRR?R@tisfileRCRrRsRttevaltlenRb(R5RRRtbreakpoint_linenumberstbreakpoint_linenumber((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR3
s


cCs4|j}|jd�}|j|�}||_dS(s3Retrieves all the breakpoints in the current windowRSN(R9t
tag_rangestranges_to_linenumbersR7(R5R9trangestlinenumber_list((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRus	cCs�g}x�tdt|�d�D]f}tt||j��}tt||dj��}x'||kr�|j|�|d7}q^WqW|S(Niii(trangeR�ReRftstringR](R5R�RR[Rtend((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�!s
cCs|j�tj|�dS(s7Extend base method - clear breaks when module is closedN(RkRt_close(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�2s
(RIs<<cut>>RJ(RKs<<copy>>RL(RMs	<<paste>>RNN(sSet Breakpoints<<set-breakpoint-here>>N(sClear Breakpoints<<clear-breakpoint-here>>N(Rt
__module__t__doc__R8Rtrmenu_specsRzRGRbR;R<RkR�R3RuR�R�(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR2}s"						*			tPyShellFileListcBs&eZdZeZdZdd�ZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjj�n.t|�|_|jrJ|jj�sJdSn|jS(N(R^ttoptwakeuptPyShelltbeginR(R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR>As		N(RR�R�R2RRR^R>(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�8stModifiedColorDelegatorcBs2eZdZd�Zd�Zd�Zd�ZRS(s8Extend base class: colorizer for the shell window itselfcCstj|�|j�dS(N(R	R8tLoadTagDefs(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8Os
cCs7|jddd�|jddd�tj|�dS(NtTODOs1.0tiomarktSYNC(RiRZR	trecolorize_main(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�SscCs{tj|�tj�}|jjiidd6dd6d6tj|d�d6tj|d�d6tj|d�d6�dS(NRRRQtstdintstdouttstderrtconsole(R	R�RRTttagdefsR-RRU(R5RX((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�Xs
cCs+x$|jD]}|j|dd�q
WdS(NR�R�(R�Ri(R5ttag((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytremovecolorsbs(RR�R�R8R�R�R�(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�Ls
			
tModifiedUndoDelegatorcBs&eZdZdd�Zdd�ZRS(s;Extend base class: forbid insert/delete before the I/O markcCs[y-|jj|dd�r,|jj�dSWntk
r@nXtj||||�dS(Nt<R�(tdelegatetcompareRdtTclErrorR
Rc(R5R[tcharsttags((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRcjs

cCsXy-|jj|dd�r,|jj�dSWntk
r@nXtj|||�dS(NR�R�(R�R�RdR�R
tdelete(R5tindex1tindex2((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�ss

N(RR�R�RRcR�(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�gs	tMyRPCClientcBseZd�ZRS(cCs
t�dS(s0Override the base class - just re-raise EOFErrorN(tEOFError(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt
handle_EOFs(RR�R�(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�}stModifiedInterpretercBsIeZd�Zd Zd Zd Zd�Zd�Zd�Z	e
dd�Zd�Zd�Z
d�Zd	�Ze
d
�Zd Zd�Zd Zd�Zd
�Zd�Zd�ZdZd�Zd d�Zd�Zd�Zd�Zd d�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'RS(!cCsf||_tjdj}tj|d|�d|_t|_	d|_
t|_|j
jj|_dS(Nt__main__tlocals(t	tkconsoletsystmodulest__dict__RR8Rtsave_warnings_filtersRyt
restartingtsubprocess_arglisttPORTtporttcompiletcompilertflagstoriginal_compiler_flags(R5R�R�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8�s					cCsL|jdkr!|j�|_n|j}tjtjtj|�|_dS(N(	R�Rtbuild_subprocess_arglistR?tspawnvtP_NOWAITR�t
executabletrpcpid(R5RH((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytspawn_subprocess�s	cCs�gtjD]}d|^q
}dddkr@|jd�ntjdddd	td
d�}tdkr}d
|f}n
d|f}tjd dkr�dtjkr�dtj}n	tj}|g|d|t	|j
�gS(Ns-Wiiis-QnewtmaintGeneralsdelete-exitfunctdefaultttypetboolsidlelib.PyShells&__import__('idlelib.run').run.main(%r)s__import__('run').main(%r)itwint s"%s"s-c(R�twarnoptionsR]Rt	GetOptionRyRtplatformR�RvR�(R5RRmt	del_exitftcommandtdecorated_exec((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s 
"	cCs�t|jf}xZtd�D]>}tj|�yt|�|_PWqtjk
rYqXqW|j	�dS|jjj�d|_t
dkr�|jjjtjtjd�n|j�|jjjd�y|jj�Wntjk
r|j�dSX|jjd|j�|jjd|jj�|jjd|jj�|jjd|jj�|jjd	|jj�|jjd
t�|jjd|�|jdt�|j�|jS(
Niiii
R�R�R�R�R=RR_twith_cwd( tHOSTR�R�ttimetsleepR�trpcclttsocketterrortdisplay_port_binding_errorRtlistening_socktgetsocknameR�t
setsockoptt
SOL_SOCKETtSO_REUSEADDRR�t
settimeouttacceptttimeouttdisplay_no_subprocess_errortregisterR�R�R�R�R=Rt
transfer_pathRztpoll_subprocess(R5taddrti((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytstart_subprocess�s>




RPcCs�|jr|jSt|_|j�}|rLytj|j�WqLqLXn|jj�|j�|j}|j	}t
|_	|j�y|jj�Wnt
jk
r�|j�dSX|jd|�|j�|jjdd�d|r�|nd}t|j�t|�ddd}|jd	j||��|jjd
d�|jjd
d�|su|j�n|r�tj|j�|j�n|j|j j!_"t
|_|jS(NR�R�send-1cs	RESTART: tShelliiRns
{0} {1} {0}trestarttleft(#R�R�RztgetdebuggerRtclose_subprocess_debuggertclosetunix_terminateR�t	executingRyR�R�R�R�R�RR�t
stop_readlineR9R�RetwidthR�R!tformattmark_settmark_gravityt
showprompttrestart_subprocess_debuggertload_breakpointsR�R�R�R�(R5R�RRaR�t
was_executingR�thalfbar((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytrestart_subprocess�sH		

			


%

	cCs|jjdddi�dS(Ntexectinterrupt_the_server((R�t
remotecall(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt__request_interruptscCstjd|j�j�dS(Nttarget(t	threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytinterrupt_subprocessscCsp|jdk	r(|jjj|j�ny|jj�Wntk
rLnX|j�t	|j_
d|_dS(N(t_afteridRR�R9tafter_cancelR�R�R"R�RyR�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytkill_subprocesss

cCsnttd�rjytj|jt�Wntk
r:dSXytj|jd�Wqjtk
rfdSXndS(s;UNIX: make sure subprocess is terminated and collect statustkillNi(thasattrR?RR�RtOSErrortwaitpid(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�s

cCsC|r"dg}|jtj�n	tj}|jd|f�dS(NRPsRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
(textendR�R@t
runcommand(R5R�R@((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�'s		cCs�|j}|dkrdSy|j|jdd�}Wn:tttfk
rq|jjr^dSd}|j	�nX|rn|jj
�d|_|\}}|jj}|dkr�|dk	rFtt
|�d|�qFnl|dkr|jjd�rF|j�qFn>|dkrFd}t||dtj�t||d|�ny|jj�Wqntk
rjqnXn|jjs�|jjj|jj|j�|_ndS(	Ntwaitg�������?tOKRt	EXCEPTIONs<<toggle-jit-stack-viewer>>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR:
(R�Rtpollresponset
active_seqR�R#tKeyboardInterruptR�tclosingR�tresetoutputR�tprinttreprtgetvartremote_stack_viewerR�t
__stderr__tendexecutingR"R9taftertpollintervalR�R	(R5tclttresponsethowtwhatR�terrmsg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�6s@	
	
cCs
||_dS(N(R`(R5R`((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytsetdebugger^scCs|jS(N(R`(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�ascCs|jjjd|j�dS(s�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�R9R!R(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytopen_remote_stack_viewerds
cCs�ddlm}|jjdddi�}|dkrK|jjj�dS|j|j|�}ddl	m
}m}t|jj�}t
j�}t
j|d�d}||d	|d
d�}	|	jjdd
dd�||	jd|�}
|
j�dS(Ni����(tRemoteObjectBrowserR�tstackviewerR=(tScrolledCanvastTreeNodetnormalRRtbgthighlightthicknessitexpanditfilltboth(R=(tidlelibR*R�tremotequeueRR�RxRdtStubObjectTreeItemtidlelib.TreeWidgetR,R-tToplevelRRTRUtframetpacktcanvasR1(R5R*toidtitemR,R-R�RXRRtsctnode((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRqsicCs#|j|�}|j||�dS(s1Like runsource() but assumes complete exec sourceN(tstuffsourcetexecfile(R5tsourceR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt
execsource�scCs�|dkr$t|d�j�}nyt||ddt�}WnWttfk
r�|jj�t	dd|jj
�tj||�|jj
�nX|j|�dS(sExecute an existing fileRlR�tdont_inheritsB*** Error in script or command!
Traceback (most recent call last):RN(RRrtreadR�Rzt
OverflowErrortSyntaxErrorR�RRR�RtshowsyntaxerrorR�truncode(R5RRBtcode((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRA�s
	
cCs�|j|�}d|_tj|_tjdddt�t|t�r�t	j
dkr�y#dt	j
|jt	j
�f}Wq�tk
r�|j
j�|jd�dSXnztj|||�SWd|jdk	r�|jtj(d|_nXdS(	sBExtend base class method: Stuff the source in the line cache firstitactionR�Rsutf-8s# -*- coding: %s -*-
%ss Unsupported characters in input
N(R@tmoreR&tfiltersR�tfilterwarningst
SyntaxWarningt
isinstancetunicodeRtencodingtencodetUnicodeErrorR�RR!Rt	runsourceR(R5RBR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRU�s$	




cCsSd|j}|jd|_|jd�}t|�dd||ftj|<|S(s"Stuff source in the filename caches<pyshell#%d>is
i(tgidtsplitR�RR*(R5RBRR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR@�s

#cCs|jd|f�dS(s>Prepend sys.path with file's directory if not already includeds(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(R5R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytprepend_syspath�sc
Cs|jj}|j�}|r�|\}}}}|dkrMd|d}nd|d|df}|jd|�|j|�|j|�}	|	r�|	tkr�|jd|d|�n|jj�|jdt	|��n|jj�t
j||�|jj�dS(s�Extend base class method: Add Colorizing

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

        isiomark + %d charss&iomark linestart + %d lines + %d charsRs
 wordstartsSyntaxError: %s
N(
R�R9tunpackerrorRZtseetgett
IDENTCHARSRR!RvRRHR�(
R5RR9tstufftmsgRtoffsetRtpostchar((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRH�s$


c
Cs�tj�\}}}|tk}|rey+|\}\}}}}	|sQd}nWqed}qeXn|r{||||	fSdSdS(Ni(R�texc_infoRGR(
R5R�tvaluettbtokR^tdummy_filenameRR_R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRY�s

cCsJ|jj�|j�tj|�|jjd�rF|jj�ndS(s1Extend base class method to reset output properlys<<toggle-jit-stack-viewer>>N(R�RtchecklinecacheRt
showtracebackRtopen_stack_viewer(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRh�s



cCsFtj}x6|j�D](}|d |ddkr||=qqWdS(Nii����s<>(RR*tkeys(R5tcR0((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRg�s	cBsQ|jjr|j�dS|jrB|jjdd|fi�n||jUdS(s*Run the code without invoking the debuggeriR�RIi(R�R�tdisplay_executing_dialogR�R5R�(R5RJ((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�s
	cBs�|jjr|jj�n|j�|jdk	rN|jej(d|_n|j	}zGyr|jj
�|r�|jdk	r�|jjdd|fi�|_
n'|r�|j||j�n||jUWn�ek
r%|jjsejddddd|jj�r�q"|j�q��nxer^edd	|jj�|j�|jj�q�|jjr�e|j_ed
d	|jj�q�|j�nXWdes�y|jj�Wq�ek
r�q�XnXdS(sOverride base class methodR�RIsExit?sDo you want to exit altogether?R�tyesRqs IDLE internal error in runcode()RRN(R�R�R_R�RgR�RR&RMR`tbeginexecutingR�t
asyncqueueRtrunR�t
SystemExitRR{taskyesnoR9Rhtuse_subprocessRR�R tcanceledRyR"(R5RJR`((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRI
sR

	


	


cCs|jjj|�dS(sOverride base class methodN(R�R�R!(R5R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!;scCs tjddd|jj�dS(NsPort Binding ErrorsAIDLE 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.Rq(R{R|R�R9(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�?scCs tjddd|jj�dS(NsSubprocess Startup Errors�IDLE's subprocess didn't make connection.  Either IDLE can't start a subprocess or personal firewall software is blocking the connection.Rq(R{R|R�R9(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�JscCs tjddd|jj�dS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Rq(R{R|R�R9(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRlRsN((RR�R8RR	R�R�R�R�R�RyR�RRRR�R�RR�R`R(R�R)RRVRCRARUR@RXRHRYRhRgRRIR!R�R�Rl(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��sH	
			+-				
	&			
										1			R�cBs�eZde�dZeZeZd2d3d4d5d6d7gZddl	m
Z
d8d�Zd�Z
eZeZeZeZeZeZd�Zd�Zd8d�Zd�Zd8d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!dZ"d �Z#d!�Z$d"�Z%d#�Z&d8d$�Z'd%�Z(d&�Z)d'�Z*d(�Z+d)�Z,d8d*�Z-d8d+�Z.d8d,�Z/d-�Z0d.�Z1d9d/�Z2d0�Z3d1�Z4RS(:sPython s ShellRt_Fileteditt_EditRat_Debugtoptionst_Optionstwindowst_Windowthelpt_Helpi����(tHistorycCsatr9|j}|dddkr9|jdd�q9nt|�|_|dkr�t�}t|�|j�t	|�}nt
j||dd�t|_
d|_t|_|j}|jdd�|jd|j�|jd	|j�|jd
|j�|jd|j�|jd|j�|jd
|j�|jd|j�tr~|jd|j�|jd|j�ntj|_tj|_ tj!|_"ddl#m$}t%|d|j&�|_!t'|d|j&�|_t'|d|j&�|_t'|d|j&�|_(ts?|jt_|jt_|j!t_!n|j)|j�|_*d|_+dS(NiitshelltShe_llitwrapRas<<newline-and-indent>>s<<plain-newline-and-indent>>s<<interrupt-execution>>s<<end-of-file>>s<<open-stack-viewer>>s<<toggle-debugger>>s<<toggle-jit-stack-viewer>>s<<view-restart>>s<<restart-shell>>i����(RR�R�R�R�i2(R�R�(,Rst
menu_specsRcR�R_RtTkRtwithdrawR�RR8Rztusetabstindentwidthtcontext_use_ps1R9t	configureR:tenter_callbacktlinefeed_callbacktcancel_callbackteof_callbackRittoggle_debuggerttoggle_jit_stack_viewertview_restart_markt
restart_shellR�R�tsave_stdoutR�tsave_stderrR�t
save_stdinR4RtPseudoInputFileRRtPseudoOutputFileR�RthistoryR"(R5R=tmsRxR9R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8psP		

				cCstjdt�S(Nt
shell_only(Rt
GetExtensionsRz(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytget_standard_extension_names�scCs
|adS(N(R (R5tstream((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytset_warning_stream�scCstS(N(R (R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytget_warning_stream�scCs`|jr0tjddd|j�|j�dS|jj�}|rR|j�n
|j�dS(NsDon't debug nows*You can only toggle the debugger when idleRqRO(	R�R{R|R9tset_debugger_indicatorR_R�tclose_debuggert
open_debugger(R5Rgtdb((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s		


cCs%|jj�}|jd|�dS(Ns<<toggle-debugger>>(R_R�tsetvar(R5R�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��scCsdS(N((R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��scCs�|jj�}|r�|jjd�|j�|jjrQtj|jj�n|j�|j	j
d�dt_|j
�n|j�dS(Ns[DEBUG OFF]
s>>> (R_R�R(RR�R�Rtclose_remote_debuggerRR�R!R�tps1R�R�(R5R�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s

	
cCsq|jjr'tj|jj|�}ntj|�}|jj|�|j�dt_|j	�|j
�dS(Ns[DEBUG ON]
>>> (R_R�Rtstart_remote_debuggerRR(R�R�R�R�R�(R5tdbg_gui((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s
	
cCs|j�d|_dS(sHelper for ModifiedInterpreteriN(RR�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRn�s
cCs d|_d|_|j�dS(sHelper for ModifiedInterpreteriN(R�RtR�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR �s		cCsf|jr=tjddddd|j�}|tkr=dSn|j�t|_t|_t	j
|�S(sExtend EditorWindow.close()sKill?s7Your program is still running!
 Do you want to kill it?R�ReRqtcancel(R�R{taskokcancelR9RyR�RzRtRRR�(R5R$((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s	
		cCs||j�tr |jj�n|jt_|jt_|j	t_
d|_d|_d|j
_d|_tj|�dS(sEExtend EditorWindow._close(), shut down debugger and execution serverN(R�RsR_RR�R�R�R�R�R�R�RR�R=R^R�RR�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s
			cCstS(s8Override EditorWindow method: never remove the colorizer(Rz(R5R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytispythonsourcescCs|jS(N(tshell_title(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytshort_titlessHType "help", "copyright", "credits" or "license()" for more information.cCs�|j�tr<d}|jj�}|sB|j�tSnd}|jdtjtj	|j
|f�|jj�|j
�ddl}d|_tS(NRPs==== No Subprocess ====sPython %s on %s
%s
%si����(RRsR_R�R�RyR!R�tversionR�t	COPYRIGHTR9tfocus_forceR�tTkinterRt
_default_rootRz(R5tnosubtclientR�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�s

	

	cCs'|js
dSt|_|jj�dS(N(treadingRzt_stop_readline_flagR�tquit(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�'s		cCs|j}zd|_|jj�Wd||_X|jrFt|_dS|jjdd�}t|�dkrvd}nt|t	�r�ddl
m}y|j|j
�}Wq�tk
r�q�Xn|j�|jr�d|_ts�t�q�n|jrd|_d}n|S(	NiRPR�send-1cis
i����(R(R�R�tmainloopR�RyR9R[R�RPRQR4RRSRRRTRRtRsRt	endoffile(R5R/RR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytreadline-s4		
			

					cCstS(N(Rz(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytisattyJscCs�y |jjddd�rdSWnnX|jp9|jsd|j�|jjd�|j�dSd|_d|_	|jr�|jj
r�|jj�r�|jj�q�|jj
�n|jr�|jj�ndS(Ns	sel.firsts!=ssel.lastsKeyboardInterrupt
ROii(R9R�R�R�RR_R!R�R�RtR�R�R�RR�R�(R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�Ms&

			cCs�|jr|jrdS|jjddd�oD|jjddd�sKdS|jsk|j�|j�nd|_d|_|jj	�dS(NR�s==Rcsend-1ciiRO(
R�R�R9R�RR�RtR�R�R�(R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�cs	

		
cCs@|jr/|jjdd�|jjd�n
|j|�dS(NRcs
RO(R�R9RcRZtnewline_and_indent_event(R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�rs
	
cCs�|jr|jrdSyN|jjdd�}|rd|jjddd�rd|j||�dSnWnnX|jjddd�r�|jjd	d�}|r�|jjdd|d
�r�|j|jj|d|d
�|�dS|jjd	d�}|rK|jjdd
|d�rK|j|jj|d|d
�|�dS|jjdd�}|r�|jj|ddd�r�|j|jj|d
d�|�n|j|jjdd�|�dS|jjddd�r�|jjdd�n|jjdd�}|r7|j	�r7|jj
dd�n|jjddd�r`|j|�dS|jjdd�|jr�|jjdd�|jj
d�n
|j|�|jjd	dd�|jj�|jr�|jj�n
|j�dS(Ns	sel.firstssel.lasts<=R�RORcR�siomark linestartR�iisinsert lineends>=R�sinsert linestartsend-1csend-1c linestarts
(R�R�R9R[R�trecallt
tag_prevranget
tag_nextrangeR�RR�R�RcRZRZtupdate_idletasksR�R�trunit(R5RgtseltprevtnexttindicesR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�{sX"'"'&
	

	
cCs�tjdd|�}tjdd|�}|jd�}|jj�z@|jjddd�|jjdd	�|jjd
d�}|j�j	d�r�|j
|�|jjd
d�}n|jjd|dj��t
|�d
kr�tjd|d�jd�}tjd|�jd�}xX|d
D]I}|j|�ra||t
|�}n|jjdd|j��q5WnWd|jjd�|jj�XdS(Ns^\s*\nRPs\n\s*$s
R�s1.0R�Rcsend-1csinsert linestartt:iis	^([ \t]*)(tretsubRWR9tundo_block_startRiR�R[trstriptendswithR�RcRR�tsearchtgroupRtRZtundo_block_stop(R5RRgRtprefixtorig_base_indenttnew_base_indentR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s*

(cCs�|jjdd�}t|�}x.|dkrQ||ddkrQ|d}q$W|dkr||ddkr|d}nx.|dkr�||ddkr�|d}q�W|| }|jj|�dS(NR�send-1ciis 	s
(R9R[R�R_RU(R5RR�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s# 
#
cCso|jjr|jj�SytjWn!tjddd|j�dSXddlm	}||j
|j�dS(NsNo stack traces@There is no stack trace yet.
(sys.last_traceback is not defined)Rqi����(tStackBrowser(R_R�RR�tlast_tracebackR{R|R9tidlelib.StackViewerR�RxR=(R5RgR�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRi�s
	
cCs$|jjd�|jjd�dS(NR�R�(R9RZ(R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��scCs|jjdt�dS(s&Callback for Run/Restart Shell Cntl-F6R�N(R_R�Rz(R5Rg((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��scCsk|j�yttj�}Wn
d}nX|jj|�|jjdd�|j�|j	j
�dS(NRPRcsend-1c(RRvR�R�R�R!R9R�tset_line_and_columnRDt
reset_undo(R5R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s


cCs�|jjdd�}|jr1|jj|�n|jjd�dkr_|jjdd�n|jjdd�|j�dtj_	dS(NR�send-1csend-2cs
i(
R9R[R�tstoreRcR�R�R�R�t	softspace(R5RB((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRs	
cCsry@|jjdd�tj|||d�|jjdd�WnnX|jrnd|_tsnt�qnndS(NR�trightR�i(R9R�RR!RtRsR(R5RR�((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!
s		cCsHy |jjddd�rdSWntk
r4dSXtt|�j�S(Ns	sel.firstR�R�tdisabled(R9R�R�tsuperR�RJ(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRJs
cCs/|jjddd�rdStt|�j�S(NRcR�R�R�(R9R�R�R�RN(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRN!s(RRu(RvRw(RaRx(RyRz(R{R|(R}R~N((5RR�RR�R�R	R�R
R�tidlelib.IdleHistoryRRR8R�RyR�R�RtR�RR�R�R�R�R�R�R�R�RnR R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RiR�R�R�RR!RJRN(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�Zsd	2					
															?				
	t
PseudoFilecBs;eZdd�Zed��Zed��Zd�ZRS(cCs(||_||_d|_||_dS(Ni(R�R�R�t	_encoding(R5R�R�RR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8(s			cCs|jS(N(R�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyRR.scCsd|jS(Ns<%s>(R�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytname2scCstS(N(Rz(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�6sN(RR�RR8tpropertyRRR�R�(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�&sR�cBseZd�Zd�ZRS(cCstS(N(Rz(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytwritable<scCs�|jrtd��nt|�tttfkr�t|t�r]tj|td��}q�t|t�r~tj
|�}q�t|t�r�tj
|�}q�tdt|�j��n|j
j||j�S(Nswrite to closed filesmust be string, not (tclosedR\R�RQRvt	bytearrayRPt__getitem__tsliceRt__str__t	TypeErrorRR�R!R�(R5R((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR!?s	(RR�R�R!(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�:s	R�cBs>eZdd�Zd�Zdd�Zdd�Zd�ZRS(cCs#tj||||�d|_dS(NRP(R�R8t_line_buffer(R5R�R�RR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR8QscCstS(N(Rz(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pytreadableUsi����cCs|jrtd��n|dkr-d}n1t|ttf�s^tdt|�j��n|j	}d|_	|dkr�x�t
r�|jj�}|s�Pn||7}qWnSx9t
|�|kr�|jj�}|s�Pn||7}q�W|||_	|| }|S(Nsread from closed filei����smust be int, not RPi(R�R\RRPRetlongR�R�RR�RzR�R�R�(R5tsizetresultR((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyREXs,					

cCs�|jrtd��n|dkr-d}n1t|ttf�s^tdt|�j��n|j	ps|j
j�}|dkr�t|�}n|j
dd|�}|dkr�|d}n|||_	|| S(Nsread from closed filei����smust be int, not is
i(R�R\RRPReR�R�R�RR�R�R�R�tfind(R5R�Rteol((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�os		

cCs|jj�dS(N(R�R�(R5((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�sN(RR�RR8R�RER�R�(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR�Os
	cCsJ|jdkrFx4dD])}|j|dd|j|d��qWndS(	s6Make paste replace selection on x11.  See issue #5124.tx11tTexttEntrytSpinboxs	<<Paste>>s%catch {%W delete sel.first sel.last}
N(R�R�R�(t_windowingsystemt
bind_class(Rxtcls((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt
fix_x11_paste�s
s�
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 (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].
cCs#tt�tat}t}t}d}d}t}y#tjtjdd�\}}Wn@tjk
r�}t	d|t
fdtj�tjd�nXx;|D]3\}	}
|	dkr�|
}t}n|	dkr�t}t}n|	dkr�t}n|	d	kr!tj
jt
�tj�n|	d
kr6t}n|	dkrKtan|	dkr�|
}tjj|�rrn t	d
|dtj�tj�t}n|	dkr�t}t}n|	dkr�|
t_t}q�q�W|r|ddkrtjj�}t}nx=tttj��D]&}tjjtj|�tj|<qW|rs|ddkrsdg|dt_n�|r�dg|t_n�|r�|g|t_n�|r,t}g}x'|D]}
|jtjj|
��q�Wxy|D]=}tjj|�}|tjkr�tjjd|�q�q�Wn1tj�}|tjkr]tjjd|�ntjddddd�}|p�|}|p�|}tdd�a t j!�ddl"m#}|t �tjj$tjjt%�d�}t&�dkrtjj$|d�}t j'd|�n�t(d kr�tj)d!kr�t(d"krId#nd$}gd4D]%}tjj$|d(||f�^qV}g|D]}t*d|�^q�}t j+j,d)d*t-t �d+|�nt.t �t/t �t0t �a1t2j3t t1�t2j4�r7t j5d,d-�t j5d,d.�t j5d,d/�n|r�|pF|s�x4|D]+}
t1j6|
�dkrQ|j7|
�qQqQW|s�t1j8�q�q�n|r�t1j9�}|s�dSt2j4�r�t1j:r�|j;j<�q�n	t1j=}|r�|j>�n|rQtj?j@d0�p tj?j@d1�}
|
rQtjj|
�rQ|jAjB|
�qQn|s]|r�|jAjCd2tjf�|r�|jAjD|�q�|r�|jAjE|�|jAjB|�q�n5|r�t2jFt �}|r�|jAjCd3|�q�nxt1jGr
t jH�q�Wt jI�tt�dS(5Nisc:deihnr:st:sError: %s
%sRis-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-RPR�R�seditor-on-startupR�R�t	classNametIdlei����(tfix_scalingtIconstWindowssidle.icoR�g!@tdarwing333333!@s.pngs.gifii i0s	idle_%d%stwmt	iconphotos-defaultR�s<B2>s<B2-Motion>s<<PasteSelection>>tIDLESTARTUPt
PYTHONSTARTUPsbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
sprint('%s')(ii i0(JR)RzRsRyRtgetoptR�targvR�Rt	usage_msgR�texitR�R!R?R@R�R�R�R�RER�R�tabspathR]tdirnameRctgetcwdRR�R�RxR�tidlelib.runR�RAt__file__Rt
wm_iconbitmapt	TkVersionR�t
PhotoImagettktcallRvRR�R�R=RtsetupApptisAquaTktunbind_classRrRhtnewR>tdictR�tlowerR^R�tenvironR[R_RARRCRXttkVersionWarningtinversedictR�tdestroy(tenable_shelltenable_editRatcmdtscripttstartuptoptsRHR^totaR�tpathxRtdirt
edit_startR�ticondirticonfiletextR�t	iconfilesticonsR�ttkversionwarning((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyR��s
#			
		
			
	$




!/"%

	
	
R�(Nt
__future__RR?tos.pathR�R�RR�R�R�RRDRRJRR�RRR�tImportErrorRRRR{tidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorR	tidlelib.UndoDelegatorR
tidlelib.OutputWindowRtidlelib.configHandlerRR4R
RRRRt
ascii_letterstdigitsR\R�R�tsignalRR R&RRR$R%R)Rzt
checkcacheR1R2R�R�R�t	RPCClientR�R�R�t
TextIOBaseR�R�R�R�RR�RR�Ry(((s4/opt/alt/python27/lib64/python2.7/idlelib/PyShell.pyt<module>s�
	


		
	�����4	>	�


Zerion Mini Shell 1.0