%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/idlelib/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/idlelib/PyShell.pyc


Pac@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZmZyddlTWn1ek
reddejejdnXddlZdd	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
rdZ1nXeja2ddl3Z3e4dZ5e4e4dZ6e4a7dZ8e8e9e4ej:dZ;e;e_:defdYZ<defd YZ=d!efd"YZ>d#e fd$YZ?d%e&j@fd&YZAd'efd(YZBd)e"fd*YZCd+ejDfd,YZEd-eEfd.YZFd/eEfd0YZGd1ZHd2ZId3ZJeKd4krejLd4ejLd)<eJne8eMdS(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((s+/usr/local/lib/python2.7/idlelib/PyShell.pytidle_formatwarning7scCsf|dkrt}ny3|jt||||d||jdWnttfk
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((s+/usr/local/lib/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((s+/usr/local/lib/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.
    iis<>N(Rtcachetlisttpoptupdate(Rtorig_checkcacheR*tsavetkey((s+/usr/local/lib/python2.7/idlelib/PyShell.pytextended_linecache_checkcachefs	
tPyShellEditorWindowcBseZdZdZdddddgZedZdZddZ	ddZ
dZdZdZ
dZdZdZRS(s6Regular text edit window in IDLE, supports breakpointscGsg|_tj|||jjd|j|jjd|j|jjd|jjt	j
jtj
d|_|jj|d}|jj||jjr|jn|jdS(Ns<<set-breakpoint-here>>s<<clear-breakpoint-here>>s<<open-python-shell>>sbreakpoints.lstcSs|j|dS(N(trestore_file_breaks(told_hooktself((s+/usr/local/lib/python2.7/idlelib/PyShell.pytfilename_changed_hooks
(tbreakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt
open_shelltostpathtjoinRt
GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR3tcolor_breakpoint_text(R5targsR6((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8s		
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((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRGscCs|j}|jj}|jdd|d|dy|jj|Wn!tk
rk|jj|nXy&|jj	j
j}|j||WnnXdS(NRSs%d.0i(
R9RDRttag_addR7tindext
ValueErrortappendR=tpyshelltinterptdebuggerR;(R5RR9Rtdebug((s+/usr/local/lib/python2.7/idlelib/PyShell.pytset_breakpoints	
cCsU|j}|jj}|s)|jdStt|jd}|j|dS(Ntinsert(R9RDRtbelltinttfloatR[Rb(R5teventR9RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR;s	
cCs|j}|jj}|s)|jdStt|jd}y|jj|WnnX|j	dddy&|j
jjj
}|j||WnnXdS(NRcRSsinsert linestartsinsert lineend +1char(R9RDRRdReRfR[R7tremovet
tag_removeR=R^R_R`R<(R5RgR9RRRa((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR<s"	
cCs|jr~|j}|jj}|s2|jdSg|_|jddty#|jjj	j
}|j|Wq~q~XndS(NRSs1.0(R7R9RDRRdRitENDR=R^R_R`tclear_file_breaks(R5R9RRa((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRks		
	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(R7RDRtopenRCt	readlinesR#t
startswithR!tupdate_breakpointststrtgetattrtroottFalsetTrueRottkMessageBoxt	showerrorR9(R5tbreaksRtold_filetlinestnew_fileRterr((s+/usr/local/lib/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(NRlRni(R9R-RDRRR?R@tisfileRCRrRsRttevaltlenRb(R5RRRtbreakpoint_linenumberstbreakpoint_linenumber((s+/usr/local/lib/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((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRus	cCsg}xtdt|dD]f}tt||j}tt||dj}x'||kr|j||d7}q^WqW|S(Niii(trangeRReRftstringR](R5RRR[Rtend((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR!s
cCs|jtj|dS(s7Extend base method - clear breaks when module is closedN(RkRt_close(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR2s
(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<RkRR3RuRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR2}s"						*			tPyShellFileListcBs&eZdZeZdZddZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjn.t||_|jrJ|jjsJdSn|jS(N(R^ttoptwakeuptPyShelltbeginR(R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR>As		N(RRRR2RRR^R>(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8stModifiedColorDelegatorcBs2eZdZdZdZdZdZRS(s8Extend base class: colorizer for the shell window itselfcCstj||jdS(N(R	R8tLoadTagDefs(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8Os
cCs7|jddd|jdddtj|dS(NtTODOs1.0tiomarktSYNC(RiRZR	trecolorize_main(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRSscCs{tj|tj}|jjiidd6dd6d6tj|dd6tj|dd6tj|dd6dS(NRRRQtstdintstdouttstderrtconsole(R	RRRTttagdefsR-RRU(R5RX((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRXs
cCs+x$|jD]}|j|ddq
WdS(NRR(RRi(R5ttag((s+/usr/local/lib/python2.7/idlelib/PyShell.pytremovecolorsbs(RRRR8RRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRLs
			
tModifiedUndoDelegatorcBs&eZdZddZddZRS(s;Extend base class: forbid insert/delete before the I/O markcCs[y-|jj|ddr,|jjdSWntk
r@nXtj||||dS(Nt<R(tdelegatetcompareRdtTclErrorR
Rc(R5R[tcharsttags((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRcjs

cCsXy-|jj|ddr,|jjdSWntk
r@nXtj|||dS(NRR(RRRdRR
tdelete(R5tindex1tindex2((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRss

N(RRRRRcR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRgs	tMyRPCClientcBseZdZRS(cCs
tdS(s0Override the base class - just re-raise EOFErrorN(tEOFError(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt
handle_EOFs(RRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR}stModifiedInterpretercBsIeZdZd Zd Zd ZdZdZdZ	e
ddZdZdZ
dZd	Ze
d
Zd ZdZd ZdZd
ZdZdZdZdZd dZdZdZdZd dZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'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(R5RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8s					cCsL|jdkr!|j|_n|j}tjtjtj||_dS(N(	RRtbuild_subprocess_arglistR?tspawnvtP_NOWAITRt
executabletrpcpid(R5RH((s+/usr/local/lib/python2.7/idlelib/PyShell.pytspawn_subprocesss	cCs|jdkstdgtjD]}d|^q%}dddkr[|jdntjddd	d
tdd}td
krd|f}n
d|f}tj	d dkrdtj
krdtj
}n	tj
}|g|d|t|jgS(Nis/Socket should have been assigned a port number.s-Wiis-QnewtmaintGeneralsdelete-exitfunctdefaultttypetboolsidlelib.PyShells&__import__('idlelib.run').run.main(%r)s__import__('run').main(%r)itwint s"%s"s-c(RtAssertionErrorRtwarnoptionsR]Rt	GetOptionRyRtplatformRRv(R5RRmt	del_exitftcommandtdecorated_exec((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs	 
"	cCst|jf}xZtdD]>}tj|yt||_PWqtjk
rYqXqW|j	dS|jjjd|_t
dkr|jjjtjtjdn|j|jjjdy|jjWntjk
r|jdSX|jjd|j|jjd|jj|jjd|jj|jjd|jj|jjd	|jj|jjd
t|jjd||jdt|j|jS(
Niiii
RRRRR=RR_twith_cwd( tHOSTRRttimetsleepRtrpcclttsocketterrortdisplay_port_binding_errorRtlistening_socktgetsocknameRt
setsockoptt
SOL_SOCKETtSO_REUSEADDRRt
settimeouttacceptttimeouttdisplay_no_subprocess_errortregisterRRRRR=Rt
transfer_pathRztpoll_subprocess(R5taddrti((s+/usr/local/lib/python2.7/idlelib/PyShell.pytstart_subprocesss>




RPcCs|jr|jSt|_|j}|rLytj|jWqLqLXn|jj|j|j}|j	}t
|_	|jy|jjWnt
jk
r|jdSX|jd||j|jjddd|r|nd}t|jt|ddd}|jd	j|||jjd
d|jjd
d|su|jn|rtj|j|jn|j|j j!_"t
|_|jS(NRRsend-1cs	RESTART: tShelliiRns
{0} {1} {0}trestarttleft(#RRRztgetdebuggerRtclose_subprocess_debuggertclosetunix_terminateRt	executingRyRRRRRRRt
stop_readlineR9RRetwidthRR!tformattmark_settmark_gravityt
showprompttrestart_subprocess_debuggertload_breakpointsRRRR(R5RRRaRt
was_executingRthalfbar((s+/usr/local/lib/python2.7/idlelib/PyShell.pytrestart_subprocesssH		

			


%

	cCs|jjdddidS(Ntexectinterrupt_the_server((Rt
remotecall(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt__request_interruptscCstjd|jjdS(Nttarget(t	threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytinterrupt_subprocessscCsp|jdk	r(|jjj|jny|jjWntk
rLnX|jt	|j_
d|_dS(N(t_afteridRRR9tafter_cancelRRR"RRyR(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytkill_subprocesss

cCsnttdrjytj|jtWntk
r:dSXytj|jdWqjtk
rfdSXndS(s;UNIX: make sure subprocess is terminated and collect statustkillNi(thasattrR?R
RRtOSErrortwaitpid(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs

cCsC|r"dg}|jtjn	tj}|jd|fdS(NRPsRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
(textendRR@t
runcommand(R5RR@((s+/usr/local/lib/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|jjdrF|jqFn>|dkrFd}t||dtjt||d|ny|jjWqntk
rjqnXn|jjs|jjj|jj|j|_ndS(	Ntwaitg?tOKRt	EXCEPTIONs<<toggle-jit-stack-viewer>>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR:
(RRtpollresponset
active_seqRR#tKeyboardInterruptRtclosingRtresetoutputRtprinttreprtgetvartremote_stack_viewerRt
__stderr__tendexecutingR"R9taftertpollintervalRR
(R5tclttresponsethowtwhatRterrmsg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR6s@	
	
cCs
||_dS(N(R`(R5R`((s+/usr/local/lib/python2.7/idlelib/PyShell.pytsetdebugger^scCs|jS(N(R`(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRascCs|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(RR9R"R(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytopen_remote_stack_viewerds
cCsddlm}|jjdddi}|dkrK|jjjdS|j|j|}ddl	m
}m}t|jj}t
j}t
j|dd}||d	|d
d}	|	jjdd
dd||	jd|}
|
jdS(Ni(tRemoteObjectBrowserRtstackviewerR=(tScrolledCanvastTreeNodetnormalRRtbgthighlightthicknessitexpanditfilltboth(R=(tidlelibR+RtremotequeueRRRxRdtStubObjectTreeItemtidlelib.TreeWidgetR-R.tToplevelRRTRUtframetpacktcanvasR2(R5R+toidtitemR-R.RRXRRtsctnode((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRqsicCs#|j|}|j||dS(s1Like runsource() but assumes complete exec sourceN(tstuffsourcetexecfile(R5tsourceR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt
execsourcescCs|dkr$t|dj}nyt||ddt}WnWttfk
r|jjt	dd|jj
tj|||jj
nX|j|dS(sExecute an existing fileRlRtdont_inheritsB*** Error in script or command!
Traceback (most recent call last):RN(RRrtreadRRzt
OverflowErrortSyntaxErrorRRRRRtshowsyntaxerrorRtruncode(R5RRCtcode((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRBs
	
cCs|j|}d|_tj|_tjdddtt|trt	j
dkry#dt	j
|jt	j
f}Wqtk
r|j
j|jddSXnztj|||SWd|jdk	r|jtj(d|_nXdS(	sBExtend base class method: Stuff the source in the line cache firstitactionRRsutf-8s# -*- coding: %s -*-
%ss Unsupported characters in input
N(RAtmoreR&tfiltersRtfilterwarningst
SyntaxWarningt
isinstancetunicodeRtencodingtencodetUnicodeErrorRRR!Rt	runsourceR(R5RCR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRVs$	




cCsSd|j}|jd|_|jd}t|dd||ftj|<|S(s"Stuff source in the filename caches<pyshell#%d>is
i(tgidtsplitRRR*(R5RCRR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRAs

#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(R5R((s+/usr/local/lib/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 charsRs
 wordstartsSyntaxError: %s
N(
RR9tunpackerrorRZtseetgett
IDENTCHARSRR!RvRRIR(
R5RR9tstufftmsgRtoffsetRtpostchar((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRIs$


c
Cstj\}}}|tk}|rey+|\}\}}}}	|sQd}nWqed}qeXn|r{||||	fSdSdS(Ni(Rtexc_infoRHR(
R5RtvaluettbtokR_tdummy_filenameRR`R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRZs

cCsJ|jj|jtj||jjdrF|jjndS(s1Extend base class method to reset output properlys<<toggle-jit-stack-viewer>>N(RRtchecklinecacheRt
showtracebackRtopen_stack_viewer(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRis



cCsFtj}x6|jD](}|d |ddkr||=qqWdS(Niis<>(RR*tkeys(R5tcR0((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRhs	cBsQ|jjr|jdS|jrB|jjdd|fin||jUdS(s*Run the code without invoking the debuggeriRRJi(RRtdisplay_executing_dialogRR6R(R5RK((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs
	cBs|jjr|jjn|j|jdk	rN|jej(d|_n|j	}zGyr|jj
|r|jdk	r|jjdd|fi|_
n'|r|j||jn||jUWnek
r%|jjsejddddd|jjrq"|jqnxer^edd	|jj|j|jjq|jjre|j_ed
d	|jjq|jnXWdesy|jjWqek
rqXnXdS(sOverride base class methodRRJsExit?sDo you want to exit altogether?RtyesRqs IDLE internal error in runcode()RRN(RRR_RRhRRR&RNR`tbeginexecutingRt
asyncqueueRtrunRt
SystemExitRR{taskyesnoR9Rituse_subprocessRRR!tcanceledRyR"(R5RKR`((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRJ
sR

	


	


cCs|jjj|dS(sOverride base class methodN(RRR!(R5R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR!;scCs 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.Rq(R{R|RR9(R5((s+/usr/local/lib/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.Rq(R{R|RR9(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRJscCs tjddd|jjdS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Rq(R{R|RR9(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRmRsN((RRR8RR
RRRRRRyRRR	RRRRRR`R)RR*RRWRDRBRVRARYRIRZRiRhRRJR!RRRm(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRsH	
			+-				
	&			
										1			RcBseZdedZeZeZd2d3d4d5d6d7gZddl	m
Z
d8dZdZ
eZeZeZeZeZeZdZdZd8dZdZd8dZdZdZdZdZdZdZdZ dZ!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/Z2d0Z3d1Z4RS(:sPython s ShellRt_Fileteditt_EditRat_Debugtoptionst_Optionstwindowst_Windowthelpt_Helpi(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_llitwrapRbs<<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(RRRRRi2(RR(,Rtt
menu_specsRcRR_RtTkRtwithdrawRRR8Rztusetabstindentwidthtcontext_use_ps1R9t	configureR:tenter_callbacktlinefeed_callbacktcancel_callbackteof_callbackRjttoggle_debuggerttoggle_jit_stack_viewertview_restart_markt
restart_shellRRtsave_stdoutRtsave_stderrRt
save_stdinR5RtPseudoInputFileRStPseudoOutputFileRRthistoryR#(R5R=tmsRxR9R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8psP		

				cCstjdtS(Nt
shell_only(Rt
GetExtensionsRz(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytget_standard_extension_namesscCs
|adS(N(R (R5tstream((s+/usr/local/lib/python2.7/idlelib/PyShell.pytset_warning_streamscCstS(N(R (R5((s+/usr/local/lib/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 idleRqRO(	RR{R|R9tset_debugger_indicatorR_Rtclose_debuggert
open_debugger(R5Rgtdb((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs		


cCs%|jj}|jd|dS(Ns<<toggle-debugger>>(R_Rtsetvar(R5R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCsdS(N((R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCs|jj}|r|jjd|j|jjrQtj|jjn|j|j	j
ddt_|j
n|jdS(Ns[DEBUG OFF]
s>>> (R_RR)RRRRtclose_remote_debuggerRRR!Rtps1RR(R5R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs

	
cCsq|jjr'tj|jj|}ntj|}|jj||jdt_|j	|j
dS(Ns[DEBUG ON]
>>> (R_RRtstart_remote_debuggerRR)RRRRR(R5tdbg_gui((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs
	
cCs|jd|_dS(sHelper for ModifiedInterpreteriN(RR(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRos
cCs d|_d|_|jdS(sHelper for ModifiedInterpreteriN(RRuR(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR!s		cCsf|jr=tjddddd|j}|tkr=dSn|jt|_t|_t	j
|S(sExtend EditorWindow.close()sKill?s7Your program is still running!
 Do you want to kill it?RRfRqtcancel(RR{taskokcancelR9RyRRzRuRRR(R5R%((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs	
		cCs||jtr |jjn|jt_|jt_|j	t_
d|_d|_d|j
_d|_tj|dS(sEExtend EditorWindow._close(), shut down debugger and execution serverN(RRtR_RRRRRRRRRRR=R^RRR(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs
			cCstS(s8Override EditorWindow method: never remove the colorizer(Rz(R5R((s+/usr/local/lib/python2.7/idlelib/PyShell.pytispythonsourcescCs|jS(N(tshell_title(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytshort_titlessHType "help", "copyright", "credits" or "license()" for more information.cCs|jtr<d}|jj}|sB|jtSnd}|jdtjtj	|j
|f|jj|j
ddl}d|_tS(NRPs==== No Subprocess ====sPython %s on %s
%s
%si(RRtR_RRRyR!RtversionRt	COPYRIGHTR9tfocus_forceRtTkinterRt
_default_rootRz(R5tnosubtclientR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs

	

	cCs'|js
dSt|_|jjdS(N(treadingRzt_stop_readline_flagRtquit(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR's		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(	NiRPRsend-1cis
i(R(RRtmainloopRRyR9R\RRQRRR5RRTRSRURRuRtRt	endoffile(R5R/RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pytreadline-s4		
			

					cCstS(N(Rz(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytisattyJscCsy |jjdddrdSWnnX|jp9|jsd|j|jjd|jdSd|_d|_	|jr|jj
r|jjr|jjq|jj
n|jr|jjndS(Ns	sel.firsts!=ssel.lastsKeyboardInterrupt
ROii(R9RRRRR_R!RRRuRRRR	RR(R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRMs&

			cCs|jr|jrdS|jjdddoD|jjdddsKdS|jsk|j|jnd|_d|_|jj	dS(NRs==Rcsend-1ciiRO(
RRR9RRRRuRRR(R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRcs	

		
cCs@|jr/|jjdd|jjdn
|j|dS(NRcs
RO(RR9RcR[tnewline_and_indent_event(R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRrs
	
cCs|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<=RRORcRsiomark linestartRiisinsert lineends>=Rsinsert linestartsend-1csend-1c linestarts
(RRR9R\Rtrecallt
tag_prevranget
tag_nextrangeRRRRRcR[RZtupdate_idletasksRRtrunit(R5RgtseltprevtnexttindicesR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR{sX"'"'&
	

	
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*\nRPs\n\s*$s
Rs1.0RRcsend-1csinsert linestartt:iis	^([ \t]*)(tretsubRXR9tundo_block_startRiRR\trstriptendswithRRcRRtsearchtgroupRtR[tundo_block_stop(R5RRgRtprefixtorig_base_indenttnew_base_indentR((s+/usr/local/lib/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
(R9R\RR_RV(R5RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs# 
#
cCso|jjr|jjSytjWn!tjddd|jdSXddlm	}||j
|jdS(NsNo stack traces@There is no stack trace yet.
(sys.last_traceback is not defined)Rqi(tStackBrowser(R_RRRtlast_tracebackR{R|R9tidlelib.StackViewerRRxR=(R5RgR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRjs
	
cCs$|jjd|jjddS(NRR(R9R[(R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCs|jjdtdS(s&Callback for Run/Restart Shell Cntl-F6RN(R_RRz(R5Rg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCsk|jyttj}Wn
d}nX|jj||jjdd|j|j	j
dS(NRPRcsend-1c(RRvRRRR!R9Rtset_line_and_columnRDt
reset_undo(R5R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs


cCs|jjdd}|jr1|jj|n|jjddkr_|jjddn|jjdd|jdtj_	dS(NRsend-1csend-2cs
i(
R9R\RtstoreRcRRRRt	softspace(R5RC((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs	
cCsry@|jjddtj|||d|jjddWnnX|jrnd|_tsntqnndS(NRtrightRi(R9RRR!RuRtR(R5RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR!
s		cCsHy |jjdddrdSWntk
r4dSXtt|jS(Ns	sel.firstRRtdisabled(R9RRtsuperRRJ(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRJs
cCs/|jjdddrdStt|jS(NRcRRR(R9RRRRN(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRN!s(RRv(RwRx(RaRy(RzR{(R|R}(R~RN((5RRRRRR	RR
Rtidlelib.IdleHistoryRRR8RRyRRRuRRRRRRRRRRRoR!RRRRRRRRRRRRRRRRjRRRRR!RJRN(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRZsd	2					
															?				
	t
PseudoFilecBs;eZddZedZedZdZRS(cCs(||_||_d|_||_dS(Ni(RRRt	_encoding(R5RRRS((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8(s			cCs|jS(N(R(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRS.scCsd|jS(Ns<%s>(R(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytname2scCstS(N(Rz(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR6sN(RRRR8tpropertyRSRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR&sRcBseZdZdZRS(cCstS(N(Rz(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytwritable<scCs|jrtdnt|tttfkrt|tr]tj|td}qt|tr~tj
|}qt|trtj
|}qtdt|jn|j
j||jS(Nswrite to closed filesmust be string, not (tclosedR\RRRRvt	bytearrayRQt__getitem__tsliceRt__str__t	TypeErrorRRR!R(R5R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR!?s	(RRRR!(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR:s	RcBs>eZddZdZddZddZdZRS(cCs#tj||||d|_dS(NRP(RR8t_line_buffer(R5RRRS((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8QscCstS(N(Rz(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pytreadableUsicCs|jrtdn|dkr-d}n1t|ttfs^tdt|jn|j	}d|_	|dkrxt
r|jj}|sPn||7}qWnSx9t
||kr|jj}|sPn||7}qW|||_	|| }|S(Nsread from closed fileismust be int, not RPi(RR\RRQRetlongRRRRRzRRR(R5tsizetresultR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRFXs,					

cCs|jrtdn|dkr-d}n1t|ttfs^tdt|jn|j	ps|j
j}|dkrt|}n|j
dd|}|dkr|d}n|||_	|| S(Nsread from closed fileismust be int, not is
i(RR\RRQReRRRRRRRRtfind(R5RRteol((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRos		

cCs|jjdS(N(RR(R5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRsN(RRRR8RRFRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyROs
	cCsJ|jdkrFx4dD])}|j|dd|j|dqWndS(	s6Make paste replace selection on x11.  See issue #5124.tx11tTexttEntrytSpinboxs	<<Paste>>s%catch {%W delete sel.first sel.last}
N(RRR(t_windowingsystemt
bind_class(Rxtcls((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt
fix_x11_pastes
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#tttat}t}t}d}d}t}y#tjtjdd\}}Wn@tjk
r}t	d|t
fdtjtjdnXx;|D]3\}	}
|	dkr|
}t}n|	dkrt}t}n|	dkrt}n|	d	kr!tj
jt
tjn|	d
kr6t}n|	dkrKtan|	dkr|
}tjj|rrn t	d
|dtjtjt}n|	dkrt}t}n|	dkr|
t_t}qqW|r|ddkrtjj}t}nx=tttjD]&}tjjtj|tj|<qW|rs|ddkrsdg|dt_n|rdg|t_n|r|g|t_n|r,t}g}x'|D]}
|jtjj|
qWxy|D]=}tjj|}|tjkrtjjd|qqWn1tj}|tjkr]tjjd|ntjddddd}|p|}|p|}tdda t j!ddl"m#}|t tjj$tjjt%d}t&dkrtjj$|d}t j'd|nt(d krtj)d!krt(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 t1t2j4r7t j5d,d-t j5d,d.t j5d,d/n|r|pF|sx4|D]+}
t1j6|
dkrQ|j7|
qQqQW|st1j8qqn|rt1j9}|sdSt2j4rt1j:r|j;j<qn	t1j=}|r|j>n|rQtj?j@d0p tj?j@d1}
|
rQtjj|
rQ|jAjB|
qQn|s]|r|jAjCd2tjf|r|jAjD|q|r|jAjE||jAjB|qn5|rt2jFt }|r|jAjCd3|qnxt1jGr
t jHqWt jIttdS(5Nisc:deihnr:st:sError: %s
%sRis-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-RPRRseditor-on-startupRRt	classNametIdlei(tfix_scalingtIconstWindowssidle.icoRg!@tdarwing333333!@s.pngs.gifii i0s	idle_%d%stwmt	iconphotos-defaultRs<B2>s<B2-Motion>s<<PasteSelection>>tIDLESTARTUPt
PYTHONSTARTUPsbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
sprint('%s')(ii i0(JR)RzRtRyRtgetoptRtargvRRt	usage_msgRtexitRR!R?R@RRRRRFRRtabspathR]tdirnameRctgetcwdRRRRxRtidlelib.runRRAt__file__Rt
wm_iconbitmapt	TkVersionRt
PhotoImagettktcallRvRRRR=RtsetupApptisAquaTktunbind_classRrRhtnewR>tdictRtlowerR^RtenvironR\R_RBRRDRYttkVersionWarningtinversedictRtdestroy(tenable_shelltenable_editRatcmdtscripttstartuptoptsRHR_totaRtpathxRtdirt
edit_startRticondirticonfiletextRt	iconfilesticonsRttkversionwarning((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs
#			
		
			
	$




!/"%

	
	
R(Nt
__future__RR?tos.pathRRRRRRRRDRRKRRRRRtImportErrorRR RR{tidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorR	tidlelib.UndoDelegatorR
tidlelib.OutputWindowRtidlelib.configHandlerRR5R
RRRRt
ascii_letterstdigitsR]RRtsignalRR R&RRR$R%R)Rzt
checkcacheR1R2RRRt	RPCClientRRRt
TextIOBaseRRRRRRRRRy(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt<module>s
	


		
	4	>	


Zerion Mini Shell 1.0