Files
PowerToys/PythonHome/Lib/idlelib/PyShell.pyc

352 lines
49 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s<>ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddl Z ddl Z ddl mZddlmZmZyddlTWn+ek
r<>ejdIJejd<00>nXddlZddlmZmZddlmZdd lmZdd
lmZdd l m!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/m0Z0Wnek
r dZ0nXeja1ddl2Z2e3d<00>Z4e3e3d<00>Z5e3a6d<00>Z7e7e8<00>e3e j9d<00>Z:e:e _9defd<00><00>YZ;defd<00><00>YZ<defd <00><00>YZ=d!efd"<00><00>YZ>d#e&j?fd$<00><00>YZ@d%efd&<00><00>YZAd'e!fd(<00><00>YZBd)e jCfd*<00><00>YZDd+eDfd,<00><00>YZEd-eDfd.<00><00>YZFd/ZGd0<00>ZHeId1kr<>ejJd1ejJd'<eH<00>ne7eK<00>dS(2i<><69><EFBFBD><EFBFBD>N(tInteractiveInterpreter(tpython_versiontsystem(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(tSIGTERMicCsyd}|d||f7}|dkr;tj||<00>}n|j<00>}|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.\Lib\idlelib\PyShell.pytidle_formatwarning8s  cCsf|dkrt}ny3|jt||||d|<00><01>|jd<00>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(RRRRtfileR((s.\Lib\idlelib\PyShell.pytidle_showwarningEs   cCsL|r*tdkrHtjatt_qHntdk rHtt_dandS(s>Replace warning.showwarning with idle_showwarning, or reverse.N(t_warnings_showwarningRtwarningst showwarningR#(tcapture((s.\Lib\idlelib\PyShell.pytcapture_warningsXs    cCsotj}i}xBt|<00>D]4}|d |ddkr|j|<00>||<qqW||<00>|j|<00>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<><69><EFBFBD><EFBFBD>s<>N(Rtcachetlisttpoptupdate(Rtorig_checkcacheR)tsavetkey((s.\Lib\idlelib\PyShell.pytextended_linecache_checkcachegs 
tPyShellEditorWindowcBs<>eZdZd<00>ZdddddgZd<00>Zdd<00>Zdd<00>Zd<00>Z d<00>Z
d<00>Z d<00>Z d<00>Z d<00>ZRS(s6Regular text edit window in IDLE, supports breakpointscGs<>g|_tj||<00>|jjd|j<00>|jjd|j<00>|jjd|jj<00>t j
j t j <00>d<00>|_|jj|d<00>}|jj|<00>|jjr<>|j<00>ndS(Ns<<set-breakpoint-here>>s<<clear-breakpoint-here>>s<<open-python-shell>>sbreakpoints.lstcSs|j<00>|<00>dS(N(trestore_file_breaks(told_hooktself((s.\Lib\idlelib\PyShell.pytfilename_changed_hook<6F>s
(t breakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt
open_shelltostpathtjoinR
t GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR2(R4targsR5((s.\Lib\idlelib\PyShell.pyR7<00>s     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|d<16>y|jj|<00>}Wn!tk
rm|jj|<00>nXy&|jj j
j }|j ||<00>WnnXdS(NtBREAKs%d.0i( R8RCRttag_addR6tindext
ValueErrortappendR<tpyshelltinterptdebuggerR:(R4RR8Rtitdebug((s.\Lib\idlelib\PyShell.pytset_breakpoint<6E>s   cCsU|j}|jj}|s)|j<00>dStt|jd<00><00><00>}|j|<00>dS(Ntinsert(R8RCRtbelltinttfloatRORW(R4teventR8RR((s.\Lib\idlelib\PyShell.pyR:<00>s  
cCs<>|j}|jj}|s)|j<00>dStt|jd<00><00><00>}y|jj|<00>WnnX|j ddd<00>y&|j
j j j }|j||<00>WnnXdS(NRXRMsinsert linestartsinsert lineend +1char(R8RCRRYRZR[ROR6tremovet
tag_removeR<RRRSRTR;(R4R\R8RRRV((s.\Lib\idlelib\PyShell.pyR;<00>s"  
 cCs<>|jr~|j}|jj}|s2|j<00>dSg|_|jddt<00>y#|jjj j
}|j |<00>Wq~q~XndS(NRMs1.0( R6R8RCRRYR^tENDR<RRRSRTtclear_file_breaks(R4R8RRV((s.\Lib\idlelib\PyShell.pyR`<00>s   
 c CsO|j}|jj}y+t|jd<00><00>}|j<00>}WdQXWntk
rYg}nXy<58>t|jd<00><00>v}x1|D])}|j|d<17>sy|j|<00>qyqyW|j <00>|j}|r<>|j|dt
|<00>d<17>nWdQXWn`tk
rJ}t |j dt <00>sKt|j _tjddd d
t
|<00>d |j<00>qKnXdS( s#Save breakpoints when file is savedtrNtwt=s
tbreakpoint_error_displayedttitles
IDLE ErrorRs$Unable to update breakpoint list:
%stparent(R6RCRtopenRBt readlinesR!t
startswithRtupdate_breakpointststrtgetattrtroottFalsetTrueRdt tkMessageBoxt showerrorR8(R4tbreaksRtold_filetlinestnew_fileRterr((s.\Lib\idlelib\PyShell.pytstore_file_breaks<6B>s.   
 
 ,  cCs<>|jj<00>|jdkr dS|jj}|dkr<dStjj|j<00>r<>t |jd<00>j
<00>}x_|D]T}|j |d<17>rpt |t |<00>d<1F>}x|D]}|j|<00>q<>WqpqpWndS(NRaRci(R8R,RCRRR>R?tisfileRBRgRhRitevaltlenRW(R4RRtRtbreakpoint_linenumberstbreakpoint_linenumber((s.\Lib\idlelib\PyShell.pyR2s     cCs4|j}|jd<00>}|j|<00>}||_dS(s3Retrieves all the breakpoints in the current windowRMN(R8t
tag_rangestranges_to_linenumbersR6(R4R8trangestlinenumber_list((s.\Lib\idlelib\PyShell.pyRjs cCs<>g}x<>tdt|<00>d<00>D]f}tt||j<00><00>}tt||dj<00><00>}x'||kr<>|j|<00>|d7}q^WqW|S(Niii(trangeRzRZR[tstringRQ(R4RRtRORtend((s.\Lib\idlelib\PyShell.pyR~s cCs|j<00>tj|<00>dS(s7Extend base method - clear breaks when module is closedN(R`Rt_close(R4((s.\Lib\idlelib\PyShell.pyR<79>+s
(RGs<<cut>>srmenu_check_cut(RIs<<copy>>RJ(RKs <<paste>>srmenu_check_pasteN(sSet Breakpoints<<set-breakpoint-here>>N(sClear Breakpoints<<clear-breakpoint-here>>N(Rt
__module__t__doc__R7Rt rmenu_specsRWR:R;R`RwR2RjR~R<>(((s.\Lib\idlelib\PyShell.pyR1~s       /   tPyShellFileListcBs&eZdZeZdZdd<00>ZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjj<00>n.t|<00>|_|jrJ|jj<00>sJdSn|jS(N(RRttoptwakeuptPyShelltbeginR(R4R\((s.\Lib\idlelib\PyShell.pyR=:s  N(RR<>R<>R1RRRRR=(((s.\Lib\idlelib\PyShell.pyR<79>1stModifiedColorDelegatorcBs2eZdZd<00>Zd<00>Zd<00>Zd<00>ZRS(s8Extend base class: colorizer for the shell window itselfcCstj|<00>|j<00>dS(N(RR7t LoadTagDefs(R4((s.\Lib\idlelib\PyShell.pyR7Hs cCs7|jddd<00>|jddd<00>tj|<00>dS(NtTODOs1.0tiomarktSYNC(R^RNRtrecolorize_main(R4((s.\Lib\idlelib\PyShell.pyR<79>LscCs<>tj|<00>tjddd<00>}|jjiidd6dd6d6tj|d<00>d6tj|d<00>d6tj|d <00>d 6<>dS(
NtmaintThemetnamet
backgroundt
foregroundtstdintstdouttstderrtconsole(RR<>R
t GetOptionttagdefsR,Rt GetHighlight(R4ttheme((s.\Lib\idlelib\PyShell.pyR<79>Qs  cCs+x$|jD]}|j|dd<00>q
WdS(NR<4E>R<>(R<>R^(R4ttag((s.\Lib\idlelib\PyShell.pyt removecolors[s(RR<>R<>R7R<>R<>R<>(((s.\Lib\idlelib\PyShell.pyR<79>Es
  
tModifiedUndoDelegatorcBs&eZdZdd<00>Zdd<00>ZRS(s;Extend base class: forbid insert/delete before the I/O markcCs[y-|jj|dd<00>r,|jj<00>dSWntk
r@nXtj||||<00>dS(Nt<R<>(tdelegatetcompareRYtTclErrorRRX(R4ROtcharsttags((s.\Lib\idlelib\PyShell.pyRXcs  cCsXy-|jj|dd<00>r,|jj<00>dSWntk
r@nXtj|||<00>dS(NR<4E>R<>(R<>R<>RYR<>Rtdelete(R4tindex1tindex2((s.\Lib\idlelib\PyShell.pyR<79>ls  N(RR<>R<>RRXR<>(((s.\Lib\idlelib\PyShell.pyR<79>`s t MyRPCClientcBseZd<00>ZRS(cCs
t<00>dS(s0Override the base class - just re-raise EOFErrorN(tEOFError(R4((s.\Lib\idlelib\PyShell.pyt
handle_EOFxs(RR<>R<>(((s.\Lib\idlelib\PyShell.pyR<79>vstModifiedInterpretercBsFeZd<00>ZdZdZdZd<00>Zd<00>Zd<00>Z e
d<00>Z d<00>Z d<00>Z d<00>Zd<00>Ze
d <00>ZdZd
<00>ZdZd <00>Zd <00>Zd <00>Zd<00>ZdZd<00>Zdd<00>Zd<00>Zd<00>Zd<00>Zdd<00>Zd<00>Zd<00>Z d<00>Z!d<00>Z"d<00>Z#d<00>Z$d<00>Z%d<00>Z&d<00>Z'RS( cCsf||_tjdj}tj|d|<00>d|_t|_ d|_
t |_ |j jj|_dS(Nt__main__tlocals(t tkconsoletsystmodulest__dict__RR7Rtsave_warnings_filtersRnt
restartingtsubprocess_arglisttPORTtporttcompiletcompilertflagstoriginal_compiler_flags(R4R<>R<>((s.\Lib\idlelib\PyShell.pyR7s     cCsL|jdkr!|j<00>|_n|j}tjtjtj|<00>|_dS(N( R<>Rtbuild_subprocess_arglistR>tspawnvtP_NOWAITR<54>t
executabletrpcpid(R4RF((s.\Lib\idlelib\PyShell.pytspawn_subprocess<73>s cCs|jdkstd<00><00>gtjD]}d|^q%}dddkr[|jd<00>ntjddd d
td d <00>}td kr<>d|f}n d|f}tj d dkr<>dtj
kr<>dtj
}n tj
}|g|d|t |j<00>gS(Nis/Socket should have been assigned a port number.s-Wiis-QnewR<77>tGeneralsdelete-exitfunctdefaultttypetboolsidlelib.PyShells&__import__('idlelib.run').run.main(%r)s__import__('run').main(%r)itwint s"%s"s-c( R<>tAssertionErrorR<72>t warnoptionsRQR
R<>RnRtplatformR<6D>Rk(R4RRbt del_exitftcommandtdecorated_exec((s.\Lib\idlelib\PyShell.pyR<79><00>s    " cCs<>t|jf}x\td<00>D]@}tj|<00>yt|<00>|_PWqtjk
r[}qXqW|j <00>dS|jj j <00>d|_t dkr<>|jj jtjtjd<00>n|j<00>|jj jd<00>y|jj<00>Wn!tjk
r}|j<00>dSX|jjd|j<00>|jjd|jj<00>|jjd|jj<00>|jjd|jj<00>|jjd |jj<00>|jjd
t<00>|jjd |<00>|jd t<00>|j<00>|jS( Niiii
R<>R<>R<>R<>R<RRStwith_cwd( tHOSTR<54>R<>ttimetsleepR<70>trpcclttsocketterrortdisplay_port_binding_errorRtlistening_sockt getsocknameR<65>t
setsockoptt
SOL_SOCKETt SO_REUSEADDRR<52>t
settimeouttacceptttimeouttdisplay_no_subprocess_errortregisterR<72>R<>R<>R<>R<Rt transfer_pathRotpoll_subprocess(R4taddrRURv((s.\Lib\idlelib\PyShell.pytstart_subprocess<73>s> 
 


cCs<>|jr|jSt|_|j<00>}|rLytj|j<00>WqLqLXn|jj<00>|j<00>|j}|j }t
|_ |j <00>y|jj <00>Wn!t jk
r<>}|j<00>dSX|jd|<00>|j<00>|jjdd<00>|r
|jd<00>|j<00>nt|j<00>ddd}|j|d|<17>|jjd d<00>|jjd d
<00>|j<00>|r<>tj|j<00>}|j<00>n|j|jj_ t
|_|jS( NR<4E>R<>send-1cs
iiRcs RESTART trestarttleft(!R<>R<>Rot getdebuggerRtclose_subprocess_debuggertclosetunix_terminateR<65>t executingRnR<>R<>R<>R<>R<>RR<>t stop_readlineR8R<>Rt
showpromptRZtwidthtmark_sett mark_gravitytrestart_subprocess_debuggertload_breakpointsR<73>R<>R<>R<>(R4R<>RVR<>t was_executingRvthalfbartgui((s.\Lib\idlelib\PyShell.pytrestart_subprocess<73>sJ    
   


  
  cCs|jjdddi<00>dS(Ntexectinterrupt_the_server((R<>t
remotecall(R4((s.\Lib\idlelib\PyShell.pyt__request_interruptscCstjd|j<00>j<00>dS(Nttarget(t threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R4((s.\Lib\idlelib\PyShell.pytinterrupt_subprocessscCsp|jdk r(|jjj|j<00>ny|jj<00>Wntk
rLnX|j<00>t |j_
d|_dS(N( t_afteridRR<>R8t after_cancelR<6C>R<>R R<>RnR<>(R4((s.\Lib\idlelib\PyShell.pytkill_subprocesss 
 cCsnttd<00>rjytj|jt<00>Wntk
r:dSXytj|jd<00>Wqjtk
rfdSXndS(s;UNIX: make sure subprocess is terminated and collect statustkillNi(thasattrR>RR<>RtOSErrortwaitpid(R4((s.\Lib\idlelib\PyShell.pyR<79>s  cCsC|r"dg}|jtj<00>n tj}|jd|f<16>dS(NtsRif 1:
import sys as _sys
_sys.path = %r
del _sys
(textendR<64>R?t
runcommand(R4R<>R?((s.\Lib\idlelib\PyShell.pyR<79>!s   cCs<>|j}|dkrdSy|j|jdd<00>}Wn:tttfk
rq|jjr^dSd}|j <00>nX|rb|jj
<00>d|_|\}}|jj }|dkr<>|dk r:|t |<00>IJq:nf|dkr|jj d<00>r:|j<00>q:n8|dkr:d}tj|I|IJ||I|IJny|jj<00>Wqbtk
r^qbXn|jjs<>|jjj|jj|j<00>|_ndS(Ntwaitg<74><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?tOKt EXCEPTIONs<<toggle-jit-stack-viewer>>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR:
(R<>Rt pollresponset
active_seqR<71>R!tKeyboardInterruptR<74>tclosingR<67>t resetoutputR<74>treprtgetvartremote_stack_viewerR<72>t
__stderr__t endexecutingR R8taftert pollintervalR<6C>R(R4tclttresponsethowtwhatR<74>terrmsg((s.\Lib\idlelib\PyShell.pyR<79>0s@              cCs ||_dS(N(RT(R4RT((s.\Lib\idlelib\PyShell.pyt setdebuggerXscCs|jS(N(RT(R4((s.\Lib\idlelib\PyShell.pyR<79>[scCs|jjjd|j<00>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<>R8RR(R4((s.\Lib\idlelib\PyShell.pytopen_remote_stack_viewer^s
c Csddlm}|jjdddi<00>}|dkrK|jjj<00>dS|j|j|<00>}ddl m
}m }t |jj<00>}t jddd <00>}t j|d
<00>d }||d |d d<00>} | jjdddd<00>|| jd|<00>}
|
j<00>dS(Ni<4E><69><EFBFBD><EFBFBD>(tRemoteObjectBrowserR<72>t stackviewerR<(tScrolledCanvastTreeNodeR<65>R<>R<>tnormalR<6C>tbgthighlightthicknessitexpanditfilltboth(sflist(tidlelibR$R<>t remotequeueRR<>RmRYtStubObjectTreeItemtidlelib.TreeWidgetR&R'tToplevelR
R<>R<>tframetpacktcanvasR+( R4R$toidtitemR&R'R<>R<>R<>tsctnode((s.\Lib\idlelib\PyShell.pyRks icCs#|j|<00>}|j||<00>dS(s1Like runsource() but assumes complete exec sourceN(t stuffsourcetexecfile(R4tsourceR((s.\Lib\idlelib\PyShell.pyt
execsource~scCs<>|dkr$t|d<00>j<00>}nyt||d<00>}Wnattfk
r<>|jj<00>|jj}|dIJ|dIJt j
||<00>|jj <00>nX|j |<00>dS(sExecute an existing fileRaR<>s *** Error in script or command!
s"Traceback (most recent call last):N( RRgtreadR<64>t OverflowErrort SyntaxErrorR<72>RR<>RtshowsyntaxerrorR<72>truncode(R4RR<tcodettkerr((s.\Lib\idlelib\PyShell.pyR;<00>s   

cCs<>|j|<00>}d|_tj|_tjdddt<00>t|tj <00>r<>ddl
m }y|j |j <00>}Wq<57>tk
r<>|jj<00>|jd<00>dSXnztj|||<00>SWd|jdk r<>|jtj(d|_nXdS( sBExtend base class method: Stuff the source in the line cache firstitactionR<6E>Ri<><69><EFBFBD><EFBFBD>(t IOBindings Unsupported characters in input
N(R:tmoreR%tfiltersR<73>tfilterwarningst SyntaxWarningt
isinstancettypest UnicodeTypeR.RFtencodetencodingt UnicodeErrorR<72>RRRt runsourceR(R4R<RRF((s.\Lib\idlelib\PyShell.pyRQ<00>s"      cCsSd|j}|jd|_|jd<00>}t|<00>dd||ftj|<|S(s"Stuff source in the filename caches <pyshell#%d>is
i(tgidtsplitRzRR)(R4R<RRt((s.\Lib\idlelib\PyShell.pyR:<00>s
 #cCs|jd|f<16>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 (R4R((s.\Lib\idlelib\PyShell.pytprepend_syspath<74>sc
Cs|jj}|j<00>}|r<>|\}}}}|dkrMd|d}nd|d|df}|jd|<00>|j|<00>|j|<00>} | r<>| tkr<>|jd|d|<00>n|jj<00>|jdt |<00><16>n|jj<00>t
j ||<00>|jj <00>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<>R8t unpackerrorRNtseetgett
IDENTCHARSRRRkRRAR<>(
R4RR8tstufftmsgRtoffsetRtpostchar((s.\Lib\idlelib\PyShell.pyRA<00>s$      c
Cs<>tj<00>\}}}|tk}|rey+|\}\}}}} |sQd}nWqed}qeXn|r{|||| fSdSdS(Ni(R<>texc_infoR@R(
R4R<>tvaluettbtokRZtdummy_filenameRR[R((s.\Lib\idlelib\PyShell.pyRU<00>s   cCsJ|jj<00>|j<00>tj|<00>|jjd<00>rF|jj<00>ndS(s1Extend base class method to reset output properlys<<toggle-jit-stack-viewer>>N(R<>RtchecklinecacheRt showtracebackRtopen_stack_viewer(R4((s.\Lib\idlelib\PyShell.pyRd<00>s
 
 cCsFtj}x6|j<00>D](}|d |ddkr||=qqWdS(Nii<><69><EFBFBD><EFBFBD>s<>(RR)tkeys(R4tcR/((s.\Lib\idlelib\PyShell.pyRc<00>s cBsQ|jjr|j<00>dS|jrB|jjdd|fi<00>n ||jUdS(s*Run the code without invoking the debuggeriR<>RBi(R<>R<>tdisplay_executing_dialogR<67>R/R<>(R4RC((s.\Lib\idlelib\PyShell.pyR <00>s 
  cBs<>|jjr|jj<00>n|j<00>|jd
k rN|jej(d
|_n|j }z;yr|jj
<00>| r<>|j d
k r<>|j j dd|fi<00>|_ n'|r<>|j||j<00>n ||jUWn<57>ek
r%|jjsejddddd|jj<00>r<01>q"|j<00>q<><01>nlerX|jjdIJ|j<00>|jj<00>q<>|jjr<>e|j_|jjd IJq<4A>|j<00>nXWd
es<>y|jj<00>Wq<57>ek
r<>q<>XnXd
S( sOverride base class methodR<64>RBsExit?sDo you want to exit altogether?R<>tyestmasters IDLE internal error in runcode()RN(R<>R<>RSR<>RcR<>RR%RHRTtbeginexecutingR<67>t
asyncqueueRtrunR<6E>t
SystemExitRRptaskyesnoR8Rdtuse_subprocessR<73>RtcanceledRnR (R4RCRT((s.\Lib\idlelib\PyShell.pyRBsR 
       

   cCs|jjj|<00>dS(sOverride base class methodN(R<>R<>R(R4R((s.\Lib\idlelib\PyShell.pyR4scCs tjddd|jj<00>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.Rj(RpRqR<>R8(R4((s.\Lib\idlelib\PyShell.pyR<79>8scCs tjddd|jj<00>dS(NsSubprocess Startup Errors<72>IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection.Rj(RpRqR<>R8(R4((s.\Lib\idlelib\PyShell.pyR<79>CscCs tjddd|jj<00>dS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Rj(RpRqR<>R8(R4((s.\Lib\idlelib\PyShell.pyRhKsN((RR<>R7RRR<>R<>R<>R<>R<>RnR<>RRRR<>R<>RR<>RTR"R<>R#RRRR=R;RQR:RTRARURdRcR RBRR<>R<>Rh(((s.\Lib\idlelib\PyShell.pyR<79>}sH
   + .     &            1  R<>cBs<>eZde<00>dZeZeZd5d6d7d8d9d:gZe j
dkrWd;ed<nddl m Z d<d<00>Zd<00>ZeZeZeZeZeZeZd<00>Zd<00>Zd<d<00>Zd<00>Zd<d<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d<00>Z!d <00>Z"d!<00>Z#d"Z$d#<00>Z%d$<00>Z&d%<00>Z'd&<00>Z(d<d'<00>Z)d(<00>Z*d)<00>Z+d*<00>Z,d+<00>Z-d,<00>Z.d<d-<00>Z/d<d.<00>Z0d<d/<00>Z1d0<00>Z2d1<00>Z3d=d2<00>Z4d3<00>Z5d4<00>Z6RS(>sPython s ShellR"t_Fileteditt_EditRVt_Debugtoptionst_Optionstwindowst_Windowsthelpt_Helptdarwint_Windowi<77><69><EFBFBD><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD>(tHistorycCsatr9|j}|dddkr9|jdd<00>q9nt|<00>|_|dkr<>t<00>}t|<00>|j<00>t |<00>}nt
j ||dd<00>t |_ d|_t |_|j}|jdd<00>|jd|j<00>|jd |j<00>|jd
|j<00>|jd |j<00>|jd |j<00>|jd |j<00>|jd|j<00>tr~|jd|j<00>|jd|j<00>ntj|_tj|_ tj!|_"ddl#m$}t%|d|j&<00>|_!t'|d|j&<00>|_t'|d|j&<00>|_t'|d|j&<00>|_(ts?|jt_|jt_|j!t_!n|j)|j<00>|_*d|_+dS(NiitshelltShe_llitwrapR]s<<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<><69><EFBFBD><EFBFBD>(RFR<>R<>R<>R<>i2(sshellR<6C>(,Rpt
menu_specsRXR<>RSRtTkRtwithdrawR<77>R R7Rotusetabst indentwidthtcontext_use_ps1R8t configureR9tenter_callbacktlinefeed_callbacktcancel_callbackt eof_callbackRettoggle_debuggerttoggle_jit_stack_viewertview_restart_markt restart_shellR<6C>R<>t save_stdoutR<74>t save_stderrR<72>t
save_stdinR.RFtPseudoInputFileROtPseudoOutputFileR<65>R~thistoryR(R4R<tmsRmR8RF((s.\Lib\idlelib\PyShell.pyR7lsP   

         cCstjdt<00>S(Nt
shell_only(R
t GetExtensionsRo(R4((s.\Lib\idlelib\PyShell.pytget_standard_extension_names<65>scCs
|adS(N(R(R4tstream((s.\Lib\idlelib\PyShell.pytset_warning_stream<61>scCstS(N(R(R4((s.\Lib\idlelib\PyShell.pytget_warning_stream<61>scCs`|jr0tjddd|j<00>|j<00>dS|jj<00>}|rR|j<00>n
|j<00>dS(NsDon't debug nows*You can only toggle the debugger when idleRjtbreak( R<>RpRqR8tset_debugger_indicatorRSR<>tclose_debuggert open_debugger(R4R\tdb((s.\Lib\idlelib\PyShell.pyR<79><00>s  

 cCs%|jj<00>}|jd| <0C>dS(Ns<<toggle-debugger>>(RSR<>tsetvar(R4R<>((s.\Lib\idlelib\PyShell.pyR<79><00>scCsdS(N((R4R\((s.\Lib\idlelib\PyShell.pyR<79><00>scCs<>|jj<00>}|r<>|jjd<00>|j<00>|jjrQtj|jj<00>n|j<00>|j j
d<00>dt _ |j <00>n|j<00>dS(Ns [DEBUG OFF]
s>>> (RSR<>R"RR<>R<>Rtclose_remote_debuggerRR<>RR<>tps1R<31>R<>(R4R<>((s.\Lib\idlelib\PyShell.pyR<79><00>s
 
  cCsq|jjr'tj|jj|<00>}ntj|<00>}|jj|<00>|j<00>dt_|j <00>|j
<00>dS(Ns[DEBUG ON]
>>> ( RSR<>Rtstart_remote_debuggerR R"R<>R<>R<>R<>R<>(R4tdbg_gui((s.\Lib\idlelib\PyShell.pyR<79><00>s  
 
cCs|j<00>d|_dS(sHelper for ModifiedInterpreteriN(RR<>(R4((s.\Lib\idlelib\PyShell.pyRk<00>s
cCs d|_d|_|j<00>dS(sHelper for ModifiedInterpreteriN(R<>RqR<>(R4((s.\Lib\idlelib\PyShell.pyR<00>s  cCsf|jr=tjddddd|j<00>}|tkr=dSn|j<00>t|_t|_t j
|<00>S(sExtend EditorWindow.close()sKill?s6The program is still running!
Do you want to kill it?R<>RaRftcancel( R<>Rpt askokcancelR8RnR<>RoRqRRR<>(R4R((s.\Lib\idlelib\PyShell.pyR<79><00>s   
  cCs||j<00>tr |jj<00>n|jt_|jt_|j t_
d|_d|_ d|j _d|_tj|<00>dS(sEExtend EditorWindow._close(), shut down debugger and execution serverN(R<>RpRSRR<>R<>R<>R<>R<>R<>R<>RR<>R<RRR<>RR<>(R4((s.\Lib\idlelib\PyShell.pyR<79><00>s
       cCstS(s8Override EditorWindow method: never remove the colorizer(Ro(R4R((s.\Lib\idlelib\PyShell.pytispythonsourcescCs|jS(N(t shell_title(R4((s.\Lib\idlelib\PyShell.pyt short_title ss@Type "copyright", "credits" or "license()" for more information.cCs<>|j<00>tr<d}|jj<00>}|sB|j<00>tSnd}|jdtjtj |j
|f<16>|j <00>ddl }d|_tS(NR
s==== No Subprocess ====sPython %s on %s
%s
%si<73><69><EFBFBD><EFBFBD>(RRpRSR<>R<>RnRR<>tversionR<6E>t COPYRIGHTR<54>tTkinterRt _default_rootRo(R4tnosubtclientR<74>((s.\Lib\idlelib\PyShell.pyR<79>s

 
  cCs'|js dSt|_|jj<00>dS(N(treadingRot_stop_readline_flagR<67>tquit(R4((s.\Lib\idlelib\PyShell.pyR<79>"s  cCs|j}zd|_|jj<00>Wd||_X|jrFt|_dS|jjdd<00>}t|<00>dkrvd}nt|t <00>r<>ddl
m }y|j |j <00>}Wq<57>tk
r<>q<>Xn|j<00>|jr<>d|_ts<>t<00>q<>n|jr d|_d}n|S( NiR
R<>send-1cis
i<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(RF(R<>R<>tmainloopR<70>RnR8RWRzRKtunicodeR.RFRNRORPRRqRpRt endoffile(R4R.RRF((s.\Lib\idlelib\PyShell.pytreadline(s4  
    
      cCstS(N(Ro(R4((s.\Lib\idlelib\PyShell.pytisattyEscCs<>y |jjddd<00>rdSWnnX|jp9|jsd|j<00>|jjd<00>|j<00>dSd|_d|_ |jr<>|jj
r<>|jj <00>r<>|jj <00>q<>|jj <00>n|jr<>|jj<00>ndS(Ns sel.firsts!=ssel.lastsKeyboardInterrupt
R<EFBFBD>ii(R8R<>R<>R<>RRSRR<>R<>RqR<>R<>R<>RR<>R<>(R4R\((s.\Lib\idlelib\PyShell.pyR<79>Hs&

   cCs<>|jr|j rdS|jjddd<00>oD|jjddd<00>sKdS|jsk|j<00>|j<00>nd|_d|_|jj <00>dS(NR<4E>s==RXsend-1ciiR<>(
R<>R<>R8R<>RR<>RqR<>R<>R<>(R4R\((s.\Lib\idlelib\PyShell.pyR<79>^s 
    cCs@|jr/|jjdd<00>|jjd<00>n |j|<00>dS(NRXs
R<EFBFBD>(R<>R8RXRVtnewline_and_indent_event(R4R\((s.\Lib\idlelib\PyShell.pyR<79>ms
  cCs<>|jr|j rdSyN|jjdd<00>}|rd|jjddd<00>rd|j||<00>dSnWnnX|jjddd<00>r<>|jjd d<00>}|r<>|jjdd|d
<19>r<>|j|jj|d |d
<19>|<00>dS|jjd d<00>}|rK|jjd d |d <19>rK|j|jj|d |d
<19>|<00>dS|jjdd<00>}|r<>|jj|d dd<00>r<>|j|jj|d
d <00>|<00>n|j|jjdd <00>|<00>dS|jjddd<00>r<>|jjdd<00>n|jjdd<00>}|r7|j <00> r7|jj
dd<00>n|jjddd<00>r`|j |<00>dS|jjdd<00>|jr<>|jj dd<00>|jj d<00>n |j |<00>|jjd dd<00>|jj<00>|jr<>|jj<00>n
|j<00>dS(Ns sel.firstssel.lasts<=R<>R<>RXR<>siomark linestartR<74>iisinsert lineends>=R<>sinsert linestartsend-1csend-1c linestarts
(R<>R<>R8RWR<>trecallt tag_prevranget tag_nextrangeR<65>RR<>R<>RXRVRNtupdate_idletasksR<73>R<>trunit(R4R\tseltprevtnexttindicesR((s.\Lib\idlelib\PyShell.pyR<79>vsX "'"'&     
cCs<>tjdd|<00>}tjdd|<00>}|jd<00>}|jj<00>z@|jjddd<00>|jjdd <00>|jjd
d<00>}|j<00>j d <00>r<>|j
|<00>|jjd
d<00>}n|jj d|d j <00><00>t |<00>d kr<>tjd|d <19>jd <00>}tjd|<00>jd <00>}xX|d D]I}|j|<00>ra||t |<00>}n|jj dd|j<00><17>q5WnWd|jjd<00>|jj<00>XdS(Ns^\s*\nR
s\n\s*$s
R<EFBFBD>s1.0R<EFBFBD>RXsend-1csinsert linestartt:iis ^([ \t]*)(tretsubRSR8tundo_block_startR^R<>RWtrstriptendswithR<68>RXRRztsearchtgroupRiRVtundo_block_stop(R4RR\Rttprefixtorig_base_indenttnew_base_indentR((s.\Lib\idlelib\PyShell.pyR<79><00>s*  (cCs<>|jjdd<00>}t|<00>}x.|dkrQ||ddkrQ|d}q$W|dkr||ddkr|d}nx.|dkr<>||ddkr<>|d}q<>W|| }|jj|<00>}dS(NR<4E>send-1ciis s
(R8RWRzRSRQ(R4RRURG((s.\Lib\idlelib\PyShell.pyR<79><00>s #  #
cCsq|jjr|jj<00>Sy tjWn!tjddd|j<00>dSXddlm }||j
|j <00>}dS(NsNo stack traces@There is no stack trace yet.
(sys.last_traceback is not defined)Rji<><69><EFBFBD><EFBFBD>(t StackBrowser( RSR<>RR<>tlast_tracebackRpRqR8tidlelib.StackViewerR<72>RmR<(R4R\R<>tsv((s.\Lib\idlelib\PyShell.pyRe<00>s    
cCs$|jjd<00>|jjd<00>dS(NR<4E>R<>(R8RV(R4R\((s.\Lib\idlelib\PyShell.pyR<79><00>scCs|jjdt<00>dS(s&Callback for Run/Restart Shell Cntl-F6R<36>N(RSR<>Ro(R4R\((s.\Lib\idlelib\PyShell.pyR<79><00>scCsk|j<00>yttj<00>}Wn d}nX|jj|<00>|jjdd<00>|j<00>|j j
<00>dS(NR
RXsend-1c( RRkR<>R<>R<>RR8R<>tset_line_and_columnRCt
reset_undo(R4R((s.\Lib\idlelib\PyShell.pyR<79><00>s


cCs<>|jjdd<00>}|jr1|jj|<00>n|jjd<00>dkr_|jjdd<00>n|jjdd<00>|j<00>dtj_ dS(NR<4E>send-1csend-2cs
i(
R8RWR<>tstoreRXR<>R<>R<>R<>t softspace(R4R<((s.\Lib\idlelib\PyShell.pyR<00>s 
cCsry@|jjdd<00>tj|||d<00>|jjdd<00>WnnX|jrnd|_tsnt<00>qnndS(NR<4E>trightR<74>i(R8R<>R RRqRpR(R4RR<>((s.\Lib\idlelib\PyShell.pyRs  cCsHy |jjddd<00>rdSWntk
r4dSXtt|<00>j<00>S(Ns sel.firstR<74>R<>tdisabled(R8R<>R<>tsuperR<72>RH(R4((s.\Lib\idlelib\PyShell.pyRHs  cCs/|jjddd<00>rdStt|<00>j<00>S(NRXR<>R<>R<>(R8R<>R<>R<>RL(R4((s.\Lib\idlelib\PyShell.pyRLs(sfileRr(RsRt(sdebugRu(RvRw(RxRy(shelpR{(RxR}N((7RR<>RR<>R<>RR<>RR<>R<>R<>tidlelib.IdleHistoryR~RR7R<>RnR<>R<>RqR<>RR<>R<>R<>R<>R<>R<>R<>R<>RkRR<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>R<>ReR<>R<>R<>RRRHRL(((s.\Lib\idlelib\PyShell.pyR<79>Ssh   2                   ?     
t
PseudoFilecBs;eZdd<00>Zed<00><00>Zed<00><00>Zd<00>ZRS(cCs(||_||_d|_||_dS(Ni(RR<>R<>t _encoding(R4RR<>RO((s.\Lib\idlelib\PyShell.pyR7#s   cCs|jS(N(R<>(R4((s.\Lib\idlelib\PyShell.pyRO)scCs d|jS(Ns<%s>(R<>(R4((s.\Lib\idlelib\PyShell.pyR<79>-scCstS(N(Ro(R4((s.\Lib\idlelib\PyShell.pyR<79>1sN(RR<>RR7tpropertyROR<>R<>(((s.\Lib\idlelib\PyShell.pyR<79>!s R<>cBseZd<00>Zd<00>ZRS(cCstS(N(Ro(R4((s.\Lib\idlelib\PyShell.pytwritable7scCs<>|jrtd<00><00>nt|<00>tttfkr<>t|t<00>rZtj|dd<00>}q<>t|t<00>r{tj |<00>}q<>t|t<00>r<>tj |<00>}q<>t
dt|<00>j <17><00>n|j j ||j<00>S(Nswrite to closed filesmust be string, not (tclosedRPR<>R<>Rkt bytearrayRKt __getslice__Rt__str__t TypeErrorRRRR<>(R4R((s.\Lib\idlelib\PyShell.pyR:s (RR<>R<>R(((s.\Lib\idlelib\PyShell.pyR<79>5s R<>cBs>eZdd<00>Zd<00>Zdd<00>Zdd<00>Zd<00>ZRS(cCs#tj||||<00>d|_dS(NR
(R<>R7t _line_buffer(R4RR<>RO((s.\Lib\idlelib\PyShell.pyR7LscCstS(N(Ro(R4((s.\Lib\idlelib\PyShell.pytreadablePsi<><69><EFBFBD><EFBFBD>cCs|jrtd<00><00>n|dkr-d}n+t|t<00>sXtdt|<00>j<17><00>n|j}d|_|dkr<>x<>t r<>|j
j <00>}|s<>Pn||7}qyWnSx9t |<00>|kr<>|j
j <00>}|s<>Pn||7}q<>W|||_|| }|S(Nsread from closed filei<65><69><EFBFBD><EFBFBD>smust be int, not R
i( R<>RPRRKRZR<>R<>RR<>RoRR<>Rz(R4tsizetresultR((s.\Lib\idlelib\PyShell.pyR>Ss,        
cCs<>|jrtd<00><00>n|dkr-d}n+t|t<00>sXtdt|<00>j<17><00>n|jpm|j j
<00>}|dkr<>t |<00>}n|j dd|<00>}|dkr<>|d}n|||_|| S(Nsread from closed filei<65><69><EFBFBD><EFBFBD>smust be int, not is
i( R<>RPRRKRZR<>R<>RR<>RR<>Rztfind(R4R<>Rteol((s.\Lib\idlelib\PyShell.pyR<79>js       cCs|jj<00>dS(N(RR<>(R4((s.\Lib\idlelib\PyShell.pyR<79>zsN(RR<>RR7R<>R>R<>R<>(((s.\Lib\idlelib\PyShell.pyR<79>Js
    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<00>tat}t}t}d}d}t}y#tjtjdd<00>\}}WnMtjk
r<>}tj j
dt |<00><16>tj j
t <00>tj d<00>nXx.|D]&\} }
| dkr<>|
}t}n| dkr<>t}t}n| dkrt}n| dkr.tjj
t <00>tj <00>n| d krCt}n| d
krXtan| d kr<>|
}tjj|<00>rnd G|GHtj <00>t}n| d kr<>t}t}n| dkr<>|
t_t}q<>q<>W|r|ddkrtjj<00>}t}nx=tttj<00><00>D]&} tjjtj| <19>tj| <qW|rs|ddkrsdg|dt_n<>|r<>dg|t_n<>|r<>|g|t_n<>|r,t}g} x'|D]} | jtjj| <00><00>q<>Wxy| D]=}tjj|<00>}|tjkr<>tjjd|<00>q<>q<>Wn1tj<00>}|tjkr]tjjd|<00>ntjddddd<00>}|p<>|}|p<>| }tdd<00>a tjj!tjjt"<00>d<00>}t#<00>dkr<>tjj!|d<00>}t j$d|<00>n<>t%dkr<>t%dkrdnd }gd-D]%}tjj!|d$||f<16>^q#}g|D]}t&d%|<00>^qU}t j'j(d&d't t <00>d(|<00>nt)t <00>t j*<00>t+t <00>a,t-j.t t,<00>|r'|p<>|s'x4|D]+} t,j/| <00>dkr<>|j0| <00>q<>q<>W|s$t,j1<00>q$q'n|rkt,j2<00>}|sCdSt-j3<00>rtt,j4rt|j5j6<00>qtn t,j7}|r<>|j8<00>n|r<>tj9j:d)<00>p<>tj9j:d*<00>} | r<>tjj| <00>r<>|j;j<| <00>q<>n|s<>|rJ|j;j=d+tjf<16>|r|j;j>|<00>q|r|j;j?|<00>|j;j<|<00>qn5|rt-j@t <00>}|r|j;j=d,|<16>qnxt,jAr<>t jB<00>q<>Wt jC<00>tt<00>dS(.Nis c:deihnr:st:s
Error: %s
is-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-R
R<>R<>seditor-on-startupR<70>R<>t classNametIdletIconstWindowssidle.icoR<6F>g!@g333333!@s.pngs.gifii i0s idle_%d%sR"twmt iconphotos-defaultt IDLESTARTUPt PYTHONSTARTUPsbif 1:
import sys as _sys
_sys.argv = %r
del _sys
s print('%s')(ii i0(DR(RoRpRnRtgetoptR<74>targvR<76>R<>RRkt usage_msgtexitR<74>R>R?RxR<>R<>R<>R>R<>RztabspathRQtdirnameRXtgetcwdR
R<>R<>RmR@t__file__Rt wm_iconbitmapt TkVersiont
PhotoImagettktcallRR<>R<>R<RtsetupAppRgR]tnewR=tisAquaTktdictR<74>tlowerRRR<>tenvironRWRSR;R R=RTttkVersionWarningt inversedictR<74>tdestroy(t enable_shellt enable_editRVtcmdtscripttstartuptoptsRFRZtotaRUtpathxRtdirt
edit_startticondirticonfiletextR<74>t iconfilesticonsRttkversionwarning((s.\Lib\idlelib\PyShell.pyR<79><00>s<>
#              
       $      ! /"%

        
R<>(LR>tos.pathR<68>R<>R<>R<>R<>R<>R<>t tracebackRLRCRRCRR<>RRR<>t ImportErrorRR<>Rptidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorRtidlelib.UndoDelegatorRtidlelib.OutputWindowR tidlelib.configHandlerR
R.R R R RRt ascii_letterstdigitsRXR<>R<>tsignalRRR%RRR#R$R(Rot
checkcacheR0R1R<>R<>R<>t RPCClientR<74>R<>R<>t
TextIOBaseR<65>R<>R<>R<>R<>RR<>Rn(((s.\Lib\idlelib\PyShell.pyt<module>s<>                 
   
 <16><16><00><16><00>g <09>