MINI MINI MANI MO

Path : /lib64/python2.7/idlelib/
File Upload :
Current File : //lib64/python2.7/idlelib/PyShell.pyo


E]c@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZyddlTWn+ek
rejdIJejdnXddlZddlmZmZddlmZdd	lmZdd
lmZddlm Z ddl!m"Z"dd
l#m$Z$ddl#m%Z%ddl#m&Z&ddl#m'Z'ddl#m(Z(ej)ej*dZ+dZ,dZ-yddl.m/Z/Wnek
rdZ/nXeja0yddl1Z1Wnek
r4n.Xe2e2dZ3e3e1_4e2dZ5e5e1_6e2ej7dZ8e8e_7defdYZ9defdYZ:defdYZ;d efd!YZ<d"e%j=fd#YZ>d$efd%YZ?d&e fd'YZ@d(ejAfd)YZBd*eBfd+YZCd,eBfd-YZDd.ZEd/ZFeGd0krejHd0ejHd&<eFndS(1iN(tInteractiveInterpreter(tpython_version(t*sK** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **i(tEditorWindowt
fixwordbreaks(tFileList(tColorDelegator(t
UndoDelegator(tOutputWindow(tidleConf(tidlever(trpc(tDebugger(tRemoteDebugger(t
macosxSupportt_s	127.0.0.1i(tSIGTERMicCsV|dkrt}ny)|jtj||||d|Wntk
rQnXdS(Ntline(tNonetwarning_streamtwritetwarningst
formatwarningtIOError(tmessagetcategorytfilenametlinenotfileR((s'/usr/lib64/python2.7/idlelib/PyShell.pytidle_showwarning<s	
cCsyd}|d||f7}|dkr;tj||}n|j}|r^|d|7}n|d|j|f7}|S(sFormat warnings the IDLE ways!
Warning (from warnings module):
s  File "%s", line %s
s    %s
s%s: %s
>>> N(Rt	linecachetgetlinetstript__name__(RRRRRts((s'/usr/lib64/python2.7/idlelib/PyShell.pytidle_formatwarningFs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.
    iis<>N(Rtcachetlisttpoptupdate(Rtorig_checkcacheR$tsavetkey((s'/usr/lib64/python2.7/idlelib/PyShell.pytextended_linecache_checkcacheSs	
tPyShellEditorWindowcBseZdZdZdddddgZdZddZddZdZ	dZ
dZdZdZ
dZRS(s6Regular text edit window in IDLE, supports breakpointscGsg|_tj|||jjd|j|jjd|j|jjd|jjt	j
jtj
d|_|jj|d}|jj||jjr|jndS(Ns<<set-breakpoint-here>>s<<clear-breakpoint-here>>s<<open-python-shell>>sbreakpoints.lstcSs|j|dS(N(trestore_file_breaks(told_hooktself((s'/usr/lib64/python2.7/idlelib/PyShell.pytfilename_changed_hookws
(tbreakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt
open_shelltostpathtjoinR	t
GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR-(R/targsR0((s'/usr/lib64/python2.7/idlelib/PyShell.pyR2ms		tCuts<<cut>>trmenu_check_cuttCopys<<copy>>trmenu_check_copytPastes	<<paste>>trmenu_check_pastesSet Breakpoints<<set-breakpoint-here>>sClear Breakpoints<<clear-breakpoint-here>>cCs|j}|jj}|jdd|d|dy|jj|}Wn!tk
rm|jj|nXy&|jj	j
j}|j||WnnXdS(NtBREAKs%d.0i(
R3R>Rttag_addR1tindext
ValueErrortappendR7tpyshelltinterptdebuggerR5(R/RR3Rtitdebug((s'/usr/lib64/python2.7/idlelib/PyShell.pytset_breakpoints	
cCsU|j}|jj}|s)|jdStt|jd}|j|dS(Ntinsert(R3R>RtbelltinttfloatRJRR(R/teventR3RR((s'/usr/lib64/python2.7/idlelib/PyShell.pyR5s	
cCs|j}|jj}|s)|jdStt|jd}y|jj|WnnX|j	dddy&|j
jjj
}|j||WnnXdS(NRSRHsinsert linestartsinsert lineend +1char(R3R>RRTRURVRJR1tremovet
tag_removeR7RMRNROR6(R/RWR3RRRQ((s'/usr/lib64/python2.7/idlelib/PyShell.pyR6s"	
cCs|jr~|j}|jj}|s2|jdSg|_|jddty#|jjj	j
}|j|Wq~q~XndS(NRHs1.0(R1R3R>RRTRYtENDR7RMRNROtclear_file_breaks(R/R3RRQ((s'/usr/lib64/python2.7/idlelib/PyShell.pyR[s		
	c	CsO|j}|jj}y+t|jd}|j}WdQXWntk
rYg}nXyt|jdv}x1|D])}|j|dsy|j|qyqyW|j	|j}|r|j|dt
|dnWdQXWn`tk
rJ}t|jdt
sKt|j_tjddd	d
t
|d|jqKnXdS(s#Save breakpoints when file is savedtrNtwt=s
tbreakpoint_error_displayedttitles
IDLE ErrorRs$Unable to update breakpoint list:
%stparent(R1R>RtopenR=t	readlinesRt
startswithRtupdate_breakpointststrtgetattrtroottFalsetTrueR_ttkMessageBoxt	showerrorR3(R/tbreaksRtold_filetlinestnew_fileRterr((s'/usr/lib64/python2.7/idlelib/PyShell.pytstore_file_breakss.	



	,
cCs|jj|jdkr dS|jj}|dkr<dStjj|jrt	|jdj
}x_|D]T}|j|drpt|t
|d}x|D]}|j|qWqpqpWndS(NR\R^i(R3R'R>RRR9R:tisfileR=RbRcRdtevaltlenRR(R/RRoRtbreakpoint_linenumberstbreakpoint_linenumber((s'/usr/lib64/python2.7/idlelib/PyShell.pyR-s


cCs4|j}|jd}|j|}||_dS(s3Retrieves all the breakpoints in the current windowRHN(R3t
tag_rangestranges_to_linenumbersR1(R/R3trangestlinenumber_list((s'/usr/lib64/python2.7/idlelib/PyShell.pyRes	cCsg}xtdt|dD]f}tt||j}tt||dj}x'||kr|j||d7}q^WqW|S(Niii(trangeRuRURVtstringRL(R/RzRoRJRtend((s'/usr/lib64/python2.7/idlelib/PyShell.pyRys
cCs|jtj|dS(s7Extend base method - clear breaks when module is closedN(R[Rt_close(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs
(RBs<<cut>>srmenu_check_cut(RDs<<copy>>RE(RFs	<<paste>>srmenu_check_pasteN(sSet Breakpoints<<set-breakpoint-here>>N(sClear Breakpoints<<clear-breakpoint-here>>N(R!t
__module__t__doc__R2Rtrmenu_specsRRR5R6R[RrR-ReRyR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR,js 						/			tPyShellFileListcBs&eZdZeZdZddZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjn.t||_|jrJ|jjsJdSn|jS(N(RMttoptwakeuptPyShelltbeginR(R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8&s		N(R!RRR,RRRMR8(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRstModifiedColorDelegatorcBs2eZdZdZdZdZdZRS(s8Extend base class: colorizer for the shell window itselfcCstj||jdS(N(RR2tLoadTagDefs(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyR24s
cCs7|jddd|jdddtj|dS(NtTODOs1.0tiomarktSYNC(RYRIRtrecolorize_main(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8scCstj|tjddd}|jjiidd6dd6d6tj|dd6tj|dd6tj|d	d	6dS(
NtmaintThemetnamet
backgroundt
foregroundtstdintstdouttstderrtconsole(RRR	t	GetOptionttagdefsR'RtGetHighlight(R/ttheme((s'/usr/lib64/python2.7/idlelib/PyShell.pyR=s
cCs+x$|jD]}|j|ddq
WdS(NRR~(RRY(R/ttag((s'/usr/lib64/python2.7/idlelib/PyShell.pytremovecolorsGs(R!RRR2RRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR1s
			
tModifiedUndoDelegatorcBs&eZdZddZddZRS(s;Extend base class: forbid insert/delete before the I/O markcCs[y-|jj|ddr,|jjdSWntk
r@nXtj||||dS(Nt<R(tdelegatetcompareRTtTclErrorRRS(R/RJtcharsttags((s'/usr/lib64/python2.7/idlelib/PyShell.pyRSOs

cCsXy-|jj|ddr,|jjdSWntk
r@nXtj|||dS(NRR(RRRTRRtdelete(R/tindex1tindex2((s'/usr/lib64/python2.7/idlelib/PyShell.pyRXs

N(R!RRRRSR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRLs	tMyRPCClientcBseZdZRS(cCs
tdS(s0Override the base class - just re-raise EOFErrorN(tEOFError(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyt
handle_EOFds(R!RR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRbstModifiedInterpretercBs@eZdZdZdZdZdZdZe	dZ
dZdZdZ
dZe	d	ZdZd
ZdZdZdZd
ZdZdZdZddZdZdZdZddZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&RS( cCsf||_tjdj}tj|d|d|_t|_	d|_
t|_|j
jj|_dS(Nt__main__tlocals(t	tkconsoletsystmodulest__dict__RR2Rtsave_warnings_filtersRit
restartingtsubprocess_arglisttPORTtporttcompiletcompilertflagstoriginal_compiler_flags(R/RR((s'/usr/lib64/python2.7/idlelib/PyShell.pyR2ks					cCsL|jdkr!|j|_n|j}tjtjtj||_dS(N(	RRtbuild_subprocess_arglistR9tspawnvtP_NOWAITRt
executabletrpcpid(R/RA((s'/usr/lib64/python2.7/idlelib/PyShell.pytspawn_subprocessxs	cCsgtjD]}d|^q
}dddkr@|jdntjdddd	td
d}tdkr}d
|f}n
d|f}tjd dkrdtjkrdtj}n	tj}|g|d|t	|j
gS(Ns-Wiiis-QnewRtGeneralsdelete-exitfunctdefaultttypetboolsidlelib.PyShells&__import__('idlelib.run').run.main(%r)s__import__('run').main(%r)itwint s"%s"s-c(RtwarnoptionsRLR	RRiR!tplatformRRfR(R/R"R]t	del_exitftcommandtdecorated_exec((s'/usr/lib64/python2.7/idlelib/PyShell.pyR~s 
"	cCst|jf}x\tdD]@}tj|yt||_PWqtjk
r[}qXqW|j	dS|jjjd|_t
dkr|jjjtjtjdn|j|jjjdy|jjWn!tjk
r}|jdSX|jjd|j|jjd|jj|jjd|jj|jjd|jj|jjd	|jj|jjd
t|jjd||jdt|j|jS(
Niiii
RRRRR7RRNtwith_cwd( tHOSTRR|ttimetsleepRtrpcclttsocketterrortdisplay_port_binding_errorRtlistening_socktgetsocknameRt
setsockoptt
SOL_SOCKETtSO_REUSEADDRRt
settimeouttacceptttimeouttdisplay_no_subprocess_errortregisterRRRRR7Rt
transfer_pathRjtpoll_subprocess(R/taddrRPRq((s'/usr/lib64/python2.7/idlelib/PyShell.pytstart_subprocesss>




cCs|jr|jSt|_|j}|rLytj|jWqLqLXn|jj|j|j}|j	}t
|_	|jy|jjWn!t
jk
r}|jdSX|jd||j|jjdd|r
|jd|jnt|jddd}|j|d||jjd	d|jjd	d
|j|rtj|j}|jn|j|jj_ t
|_|jS(NRRsend-1cs
iiR^s	 RESTART trestarttleft(!RRRjtgetdebuggerR
tclose_subprocess_debuggertclosetunix_terminateRt	executingRiRRRRRRRt
stop_readlineR3RRt
showpromptRUtwidthtmark_settmark_gravitytrestart_subprocess_debuggertload_breakpointsRRRR(R/RRQRt
was_executingRqthalfbartgui((s'/usr/lib64/python2.7/idlelib/PyShell.pytrestart_subprocesssJ		

			






	cCs|jjdddidS(Ntexectinterrupt_the_server((Rt
remotecall(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyt__request_interruptscCstjd|jjdS(Nttarget(t	threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytinterrupt_subprocessscCsHy|jjWntk
r$nX|jt|j_d|_dS(N(RRtAttributeErrorRRiRRR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytkill_subprocesss

cCsnttdrjytj|jtWntk
r:dSXytj|jdWqjtk
rfdSXndS(s;UNIX: make sure subprocess is terminated and collect statustkillNi(thasattrR9RRRtOSErrortwaitpid(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs

cCsC|r"dg}|jtjn	tj}|jd|fdS(NtsRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
(textendRR:t
runcommand(R/RR:((s'/usr/lib64/python2.7/idlelib/PyShell.pyR
s		cCs|j}|dkrdSy|j|jdd}Wn:tttfk
rq|jjr^dSd}|j	nX|rb|jj
d|_|\}}|jj}|dkr|dk	r:|t|IJq:nf|dkr|jj
dr:|jq:n8|dkr:d}tj|I|IJ||I|IJny|jjWqbtk
r^qbXn|jjs|jjj|jj|jndS(Ntwaitg?tOKt	EXCEPTIONs<<toggle-jit-stack-viewer>>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR:
(RRtpollresponset
active_seqRRtKeyboardInterruptRtclosingRtresetoutputRtreprtgetvartremote_stack_viewerRt
__stderr__tendexecutingRR3taftertpollintervalR(R/tclttresponsethowtwhatRterrmsg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs@	
	
cCs
||_dS(N(RO(R/RO((s'/usr/lib64/python2.7/idlelib/PyShell.pytsetdebuggerAscCs|jS(N(RO(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRDscCs|jjjd|jdS(sInitiate 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(RR3RR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytopen_remote_stack_viewerGs
cCsddlm}|jjdddi}|dkrK|jjjdS|j|j|}ddl	m
}m}t|jj}t
jddd	}t
j|d
d}||d|d
d}	|	jjdddd||	jd|}
|
jdS(Ni(tRemoteObjectBrowserRtstackviewerR7(tScrolledCanvastTreeNodeRRRtnormalRtbgthighlightthicknessitexpanditfilltboth(sflist(tidlelibRRtremotequeueRRRhRTtStubObjectTreeItemtidlelib.TreeWidgetRR tToplevelR	RRtframetpacktcanvasR$(R/RtoidtitemRR RRRtsctnode((s'/usr/lib64/python2.7/idlelib/PyShell.pyRTsicCs#|j|}|j||dS(s1Like runsource() but assumes complete exec sourceN(tstuffsourcetexecfile(R/tsourceR((s'/usr/lib64/python2.7/idlelib/PyShell.pyt
execsourcegscCs|dkr$t|dj}nyt||d}Wnattfk
r|jj|jj}|dIJ|dIJt	j
|||jjnX|j|dS(sExecute an existing fileR\Rs *** Error in script or command!
s"Traceback (most recent call last):N(
RRbtreadRt
OverflowErrortSyntaxErrorRRRRtshowsyntaxerrorRtruncode(R/RR5tcodettkerr((s'/usr/lib64/python2.7/idlelib/PyShell.pyR4ls


cCs|j|}d|_tj|_tjdddtt|tj	rddl
m}y|j|j
}Wqtk
r|jj|jddSXnztj|||SWd|jdk	r|jtj(d|_nXdS(	sBExtend base class method: Stuff the source in the line cache firstitactionRRi(t	IOBindings Unsupported characters in input
N(R3tmoreRtfiltersRtfilterwarningst
SyntaxWarningt
isinstancettypestUnicodeTypeR'R?tencodetencodingtUnicodeErrorRRRRt	runsourceR(R/R5RR?((s'/usr/lib64/python2.7/idlelib/PyShell.pyRJ|s"	




cCsSd|j}|jd|_|jd}t|dd||ftj|<|S(s"Stuff source in the filename caches<pyshell#%d>is
i(tgidtsplitRuRR$(R/R5RRo((s'/usr/lib64/python2.7/idlelib/PyShell.pyR3s

#cCs|jd|fdS(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(R/R((s'/usr/lib64/python2.7/idlelib/PyShell.pytprepend_syspathsc
Cs|jj}|j}|r|\}}}}|dkrMd|d}nd|d|df}|jd||j||j|}	|	r|	tkr|jd|d|n|jj|jdt	|n|jjt
j|||jjdS(sExtend 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 charsR	s
 wordstartsSyntaxError: %s
N(
RR3tunpackerrorRItseetgett
IDENTCHARSRRRfRR:R(
R/RR3tstufftmsgRtoffsetRtpostchar((s'/usr/lib64/python2.7/idlelib/PyShell.pyR:s$


c
Cstj\}}}|tk}|rey+|\}\}}}}	|sQd}nWqed}qeXn|r{||||	fSdSdS(Ni(Rtexc_infoR9R(
R/RtvaluettbtokRStdummy_filenameRRTR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRNs

cCsJ|jj|jtj||jjdrF|jjndS(s1Extend base class method to reset output properlys<<toggle-jit-stack-viewer>>N(RRtchecklinecacheRt
showtracebackRtopen_stack_viewer(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyR]s



cCsFtj}x6|jD](}|d |ddkr||=qqWdS(Niis<>(RR$tkeys(R/tcR*((s'/usr/lib64/python2.7/idlelib/PyShell.pyR\s	cBsQ|jjr|jdS|jrB|jjdd|fin||jUdS(s*Run the code without invoking the debuggeriRR;i(RRtdisplay_executing_dialogRR(R(R/R<((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs
	cBs|jjr|jjn|j|jd
k	rN|jej(d
|_n|j	}z;yr|jj
|r|jd
k	r|jjdd|fi|_
n'|r|j||jn||jUWnek
r%|jjsejddddd|jjrq"|jqnlerX|jjdIJ|j|jjq|jjre|j_|jjd	IJq|jnXWd
esy|jjWqek
rqXnXd
S(sOverride base class methodRR;sExit?sDo you want to exit altogether?Rtyestmasters IDLE internal error in runcode()RN(RRRNRR\RRRRAROtbeginexecutingRt
asyncqueueRtrunRt
SystemExitR
RktaskyesnoR3R]tuse_subprocessRRtcanceledRiR(R/R<RO((s'/usr/lib64/python2.7/idlelib/PyShell.pyR;sR

	





cCs|jjj|dS(sOverride base class methodN(RRR(R/R"((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCs tjddd|jjdS(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.Rc(RkRlRR3(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyR!scCs tjddd|jjdS(NsSubprocess Startup ErrorsIDLE's subprocess didn't make connection.  Either IDLE can't start a subprocess or personal firewall software is blocking the connection.Rc(RkRlRR3(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyR,scCs tjddd|jjdS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Rc(RkRlRR3(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRa4sN('R!RR2RRRRRRRiRRRRRRRRRORRRRRKR6R4RJR3RMR:RNR]R\RR;RRRRa(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRisF	
			+.					
	&			
										1			RcBseZdedZeZeZd6d7d8d9d:d;gZe	j
r[ed=d<ed<nddlmZd=dZdZeZeZeZeZeZeZdZdZd=dZdZd=dZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d=d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d=d.Z0d=d/Z1d=d0Z2d1Z3d2Z4d>d3Z5d4Z6d5Z7RS(?sPython s ShellRt_Fileteditt_EditRQt_Debugtoptionst_Optionstwindowst_Windowsthelpt_Helpit_Windowii(tHistorycCsatr9|j}|dddkr9|jddq9nt||_|dkrt}t||jt	|}nt
j||ddt|_
d|_t|_|j}|jdd|jd|j|jd	|j|jd
|j|jd|j|jd|j|jd
|j|jd|jtr~|jd|j|jd|jntj|_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_llitwrapRVs<<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(R?RRRRi2(sshellRx(,Rit
menu_specsRSRRNRtTkRtwithdrawRRR2Rjtusetabstindentwidthtcontext_use_ps1R3t	configureR4tenter_callbacktlinefeed_callbacktcancel_callbackteof_callbackR^ttoggle_debuggerttoggle_jit_stack_viewertview_restart_markt
restart_shellRRtsave_stdoutRtsave_stderrRt
save_stdinR'R?tPseudoInputFileRHtPseudoOutputFileRRvthistoryR(R/R7tmsRhR3R?((s'/usr/lib64/python2.7/idlelib/PyShell.pyR2VsP		

				cCstjdtS(Nt
shell_only(R	t
GetExtensionsRj(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytget_standard_extension_namesscCs
|adS(N(R(R/tstream((s'/usr/lib64/python2.7/idlelib/PyShell.pytset_warning_streamscCstS(N(R(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytget_warning_streamscCs`|jr0tjddd|j|jdS|jj}|rR|jn
|jdS(NsDon't debug nows*You can only toggle the debugger when idleRctbreak(	RRkRlR3tset_debugger_indicatorRNRtclose_debuggert
open_debugger(R/RWtdb((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs		


cCs%|jj}|jd|dS(Ns<<toggle-debugger>>(RNRtsetvar(R/R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCsdS(N((R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCs|jj}|r|jjd|j|jjrQtj|jjn|j|j	j
ddt_|j
n|jdS(Ns[DEBUG OFF]
s>>> (RNRRRRRR
tclose_remote_debuggerRRRRtps1RR(R/R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs

	
cCsq|jjr'tj|jj|}ntj|}|jj||jdt_|j	|j
dS(Ns[DEBUG ON]
>>> (RNRR
tstart_remote_debuggerRRRRRRR(R/tdbg_gui((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs
	
cCs|jd|_dS(sHelper for ModifiedInterpreteriN(RR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRds
cCs d|_d|_|jdS(sHelper for ModifiedInterpreteriN(RRjR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs		cCsz|jr=tjddddd|j}|tkr=dSn|jt|_t|_|jj	d|j
|jdS(	sExtend EditorWindow.close()sKill?s6The program is still running!
 Do you want to kill it?RRZRatcanceliN(RRktaskokcancelR3RiRRjRjR
RRtclose2(R/R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs	
		cCs
tj|S(N(RR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCs||jtr |jjn|jt_|jt_|j	t_
d|_d|_d|j
_d|_tj|dS(sEExtend EditorWindow._close(), shut down debugger and execution serverN(RRiRNRRRRRRRRRRR7RMRRR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs
			cCstS(s8Override EditorWindow method: never remove the colorizer(Rj(R/R((s'/usr/lib64/python2.7/idlelib/PyShell.pytispythonsourcescCs|jS(N(tshell_title(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytshort_titless@Type "copyright", "credits" or "license()" for more information.cCs|jtr<d}|jj}|sB|jtSnd}|jdtjtj	|j
|f|jddl}d|_tS(NRs==== No Subprocess ====sPython %s on %s
%s
%si(RRiRNRRRiRRtversionRt	COPYRIGHTRtTkinterRt
_default_rootRj(R/tnosubtclientR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs

	
	cCs'|js
dSt|_|jjdS(N(treadingRjt_stop_readline_flagRtquit(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs		cCs|j}zd|_|jjWd||_X|jrFt|_dS|jjdd}t|dkrvd}nt|t	rddl
m}y|j|j
}Wqtk
rqXn|j|jrd|_tstqn|jrd|_d}n|S(	NiRRsend-1cis
i(R?(RRtmainloopRRiR3RPRuRDtunicodeR'R?RGRHRIRRjRiRt	endoffile(R/R)RR?((s'/usr/lib64/python2.7/idlelib/PyShell.pytreadlines4		
			

					cCstS(N(Rj(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytisatty3scCsy |jjdddrdSWnnX|jp9|jsd|j|jjd|jdSd|_d|_	|jr|jj
r|jjr|jjq|jj
n|jr|jjndS(Ns	sel.firsts!=ssel.lastsKeyboardInterrupt
Rii(R3RRRRRNRRRRjRRRRRR(R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyR6s&

			cCs|jr|jrdS|jjdddoD|jjdddsKdS|jsk|j|jnd|_d|_|jj	dS(NRs==RSsend-1ciiR(
RRR3RRRRjRRR(R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyRLs	

		
cCs@|jr/|jjdd|jjdn
|j|dS(NRSs
R(RR3RSROtnewline_and_indent_event(R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyR[s
	
c	Cs|jr|jrdSyN|jjdd}|rd|jjdddrd|j||dSnWnnX|jjdddr|jjd	d}|r|jjdd|d
r|j|jj|d|d
|dS|jjd	d}|rK|jjdd
|drK|j|jj|d|d
|dS|jjdd}|r|jj|dddr|j|jj|d
d|n|j|jjdd|dS|jjdddr|jjddn|jjdd}|r7|j	r7|jj
ddn|jjdddr`|j|dS|jjdd|jr|jjdd|jj
dn
|j||jjd	dd|jj|jr|jjn
|jdS(Ns	sel.firstssel.lasts<=RRRSRsiomark linestartRiisinsert lineends>=Rsinsert linestartsend-1csend-1c linestarts
(RRR3RPRtrecallt
tag_prevranget
tag_nextrangeRR RRRSRORItupdate_idletasksRRtrunit(R/RWtseltprevtnexttindicesR"((s'/usr/lib64/python2.7/idlelib/PyShell.pyRdsX"'"'&
	

	
cCstjdd|}tjdd|}|jd}|jjz@|jjddd|jjdd	|jjd
d}|jj	dr|j
||jjd
d}n|jjd|djt
|d
krtjd|djd}tjd|jd}xX|d
D]I}|j|ra||t
|}n|jjdd|jq5WnWd|jjd|jjXdS(Ns^\s*\nRs\n\s*$s
Rs1.0R~RSsend-1csinsert linestartt:iis	^([ \t]*)(tretsubRLR3tundo_block_startRYRRPtrstriptendswithRRSR RutsearchtgroupRdROtundo_block_stop(R/R"RWRotprefixtorig_base_indenttnew_base_indentR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs*

(cCs|jjdd}t|}x.|dkrQ||ddkrQ|d}q$W|dkr||ddkr|d}nx.|dkr||ddkr|d}qW|| }|jj|}dS(NRsend-1ciis 	s
(R3RPRuRNRJ(R/RRPR@((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs# 
#
cCsq|jjr|jjSytjWn!tjddd|jdSXddlm	}||j
|j}dS(NsNo stack traces@There is no stack trace yet.
(sys.last_traceback is not defined)Rci(tStackBrowser(RNRRRtlast_tracebackRkRlR3tidlelib.StackViewerRRhR7(R/RWRtsv((s'/usr/lib64/python2.7/idlelib/PyShell.pyR^s
	
cCs$|jjd|jjddS(NRR(R3RO(R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCs|jjdtdS(s&Callback for Run/Restart Shell Cntl-F6RN(RNRRj(R/RW((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCsk|jyttj}Wn
d}nX|jj||jjdd|j|j	j
dS(NRRSsend-1c(RRfRRRRR3Rtset_line_and_columnR>t
reset_undo(R/R"((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs


cCs|jjdd}|jr1|jj|n|jjddkr_|jjddn|jjdd|jdtj_	dS(NRsend-1csend-2cs
i(
R3RPRt
history_storeRSRRRRt	softspace(R/R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs	
cCsry@|jjddtj|||d|jjddWnnX|jrnd|_tsntqnndS(NRtrightRi(R3RRRRjRiR(R/R"R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs		cCsHy |jjdddrdSWntk
r4dSXtt|jS(Ns	sel.firstRRtdisabled(R3RRtsuperRRC(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRCs
cCs/|jjdddrdStt|jS(NRSRRR(R3RRRRG(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRG
s(sfileRk(RlRm(sdebugRn(RoRp(RqRr(shelpRt(RqRuN((8R!RRRRRRRRzRtrunningAsOSXApptidlelib.IdleHistoryRvRR2RRiRRRjRR
RRRRRRRRRdRRRRRRRRRRRRRRRRRR^RRRRRRCRG(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR<sl	
2					
																?				
	t
PseudoFilecBs;eZddZedZedZdZRS(cCs(||_||_d|_||_dS(Ni(RwRRt	_encoding(R/RwRRH((s'/usr/lib64/python2.7/idlelib/PyShell.pyR2s			cCs|jS(N(R(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRHscCsd|jS(Ns<%s>(R(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCstS(N(Rj(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyRsN(R!RRR2tpropertyRHRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRsRcBseZdZdZRS(cCstS(N(Rj(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytwritable%scCs_|jrtdnt|ttfsItdt|jn|jj	||j
S(Nswrite to closed filesmust be string, not (tclosedRKRDt
basestringt	bytearrayt	TypeErrorRR!RwRR(R/R"((s'/usr/lib64/python2.7/idlelib/PyShell.pyR(s
	(R!RRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR#s	RcBs>eZddZdZddZddZdZRS(cCs#tj||||d|_dS(NR(RR2t_line_buffer(R/RwRRH((s'/usr/lib64/python2.7/idlelib/PyShell.pyR22scCstS(N(Rj(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pytreadable6sicCs|jrtdn|dkr-d}n+t|tsXtdt|jn|j}d|_|dkrxt	r|j
j}|sPn||7}qyWnSx9t||kr|j
j}|sPn||7}qW|||_|| }|S(Nsread from closed fileismust be int, not Ri(
RRKRRDRURRR!RRjRwRRu(R/tsizetresultR((s'/usr/lib64/python2.7/idlelib/PyShell.pyR79s,					

cCs|jrtdn|dkr-d}n+t|tsXtdt|jn|jpm|j	j
}|dkrt|}n|||_|| S(Nsread from closed fileismust be int, not i(RRKRRDRURRR!RRwRRu(R/RR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRPs		
cCs|jjdS(N(RwR(R/((s'/usr/lib64/python2.7/idlelib/PyShell.pyR]sN(R!RRR2RR7RR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR0s
	
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].
cCstat}t}t}d}d}t}y#tjtjdd\}}WnMtjk
r}tjj	dt
|tjj	ttjdnXx.|D]&\}	}
|	dkr|
}t}n|	dkrt}t}n|	dkrt}n|	dkr$tj
j	ttjn|	d	kr9t}n|	d
krNtan|	dkr|
}tjj|rundG|GHtjt}n|	d
krt}t}n|	dkr|
t_t}qqW|r|ddkrtjj}t}nx=tttjD]&}tjjtj|tj|<qW|ri|ddkridg|dt_n|rdg|t_n|r|g|t_n|r"t}g}x'|D]}
|jtjj|
qWxy|D]=}tjj|}|tjkrtjjd|qqWn1tj}|tjkrStjjd|ntjddddd}|pw|}|p|}tddat ttj!t"ta#t$j%tt#|r(|p|s(x4|D]+}
t#j&|
dkr|j'|
qqW|s%t#j(q%q(n|rlt#j)}|sDdSt$j*rlt#j+rl|j,j-qlnt#j.}|r|j/n|rtj0j1dptj0j1d}
|
rtjj|
r|j2j3|
qn|r|s|rQ|j2j4dtjf|r%|j2j5|qQ|rQ|j2j6||j2j3|qQnt$j7t}|r|j2j4dj8d|dfnxt#j9rtj:qWtj;dS(Nisc:deihnr:st:s
Error: %s
is-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-RRRseditor-on-startupRRt	classNametIdletIDLESTARTUPt
PYTHONSTARTUPsbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
sprint('s')(<RjRiRiRtgetoptRtargvRRRRft	usage_msgtexitRR9R:RsRRRR7R|RutabspathRLtdirnameRStgetcwdR	RR{RhRR|RR7RtsetupAppRbRXtnewR8RtdictRtlowerRMRtenvironRPRNR4RR6RMttkVersionWarningR;tinversedictRtdestroy(tenable_shelltenable_editRQtcmdtscripttstartuptoptsRARStotaRPtpathxRtdirt
edit_startRwttkversionwarning((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs#			
			
			
	$




	
	%R(IR9tos.pathRR}RRRRRt	tracebackRER>RR<RRRRtImportErrorRRRktidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorRtidlelib.UndoDelegatorRtidlelib.OutputWindowRtidlelib.configHandlerR	R'R
RRR
Rt
ascii_letterstdigitsRQRRtsignalRRRRRtshowwarningR#Rt
checkcacheR+R,RRRt	RPCClientRRRt
TextIOBaseRRRRRR!R(((s'/usr/lib64/python2.7/idlelib/PyShell.pyt<module>s



	
			
d	

OHA YOOOO