|G_Tc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZddlmZmZyddlTWn+ek rejdIJejdnXddlZddlmZmZddlmZdd 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 dZ0nXeja1ddl2Z2e3dZ4e3e3dZ5e3a6dZ7e7e8e3e j9dZ:e:e _9defdYZ;defdYZ<defd YZ=d!efd"YZ>d#e&j?fd$YZ@d%efd&YZAd'e!fd(YZBd)e jCfd*YZDd+eDfd,YZEd-eDfd.YZFd/ZGd0ZHeId1krejJd1ejJd'>> N(Rtwarning_streamtwriteRtAttributeErrortIOError(RRRRtfileR((s+/usr/local/lib/python2.7/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+/usr/local/lib/python2.7/idlelib/PyShell.pytcapture_warningsXs    cCsotj}i}xBt|D]4}|d |ddkr|j||| entries Rather than repeating the linecache code, patch it to save the 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_checkcachegs  tPyShellEditorWindowcBseZdZdZdddddgZdZddZddZdZ dZ dZ dZ dZ dZRS(s6Regular text edit window in IDLE, supports breakpointscGsg|_tj|||jjd|j|jjd|j|jjd|jjt j j t j d|_|jj|d}|jj||jjr|jndS(Ns<>s<>s<>sbreakpoints.lstcSs|j|dS(N(trestore_file_breaks(told_hooktself((s+/usr/local/lib/python2.7/idlelib/PyShell.pytfilename_changed_hooks (t breakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt open_shelltostpathtjoinR t GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR2(R4targsR5((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR7s     tCuts<>trmenu_check_cuttCopys<>trmenu_check_copytPastes <>trmenu_check_pastesSet Breakpoints<>sClear Breakpoints<>cCs|j}|jj}|jdd|d|dy|jj|}Wn!tk rm|jj|nXy&|jj j j }|j ||WnnXdS(NtBREAKs%d.0i( R8RCRttag_addR6tindext ValueErrortappendR<tpyshelltinterptdebuggerR:(R4RR8Rtitdebug((s+/usr/local/lib/python2.7/idlelib/PyShell.pytset_breakpoints   cCsU|j}|jj}|s)|jdStt|jd}|j|dS(Ntinsert(R8RCRtbelltinttfloatRORW(R4teventR8RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR:s   cCs|j}|jj}|s)|jdStt|jd}y|jj|WnnX|j dddy&|j j j j }|j||WnnXdS(NRXRMsinsert linestartsinsert lineend +1char(R8RCRRYRZR[ROR6tremovet tag_removeR<RRRSRTR;(R4R\R8RRRV((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR;s"    cCs|jr~|j}|jj}|s2|jdSg|_|jddty#|jjj j }|j |Wq~q~XndS(NRMs1.0( R6R8RCRRYR^tENDR<RRRSRTtclear_file_breaks(R4R8RRV((s+/usr/local/lib/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(R6RCRtopenRBt readlinesR!t startswithRtupdate_breakpointststrtgetattrtroottFalsetTrueRdt tkMessageBoxt showerrorR8(R4tbreaksRtold_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(NRaRci(R8R,RCRRR>R?tisfileRBRgRhRitevaltlenRW(R4RRtRtbreakpoint_linenumberstbreakpoint_linenumber((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR2s     cCs4|j}|jd}|j|}||_dS(s3Retrieves all the breakpoints in the current windowRMN(R8t tag_rangestranges_to_linenumbersR6(R4R8trangestlinenumber_list((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRjs cCsg}xtdt|dD]f}tt||j}tt||dj}x'||kr|j||d7}q^WqW|S(Niii(trangeRzRZR[tstringRQ(R4RRtRORtend((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR~s cCs|jtj|dS(s7Extend base method - clear breaks when module is closedN(R`Rt_close(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR+s (RGs<>srmenu_check_cut(RIs<>RJ(RKs <>srmenu_check_pasteN(sSet Breakpoints<>N(sClear Breakpoints<>N(Rt __module__t__doc__R7Rt rmenu_specsRWR:R;R`RwR2RjR~R(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR1~s       /   tPyShellFileListcBs&eZdZeZdZddZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjn.t||_|jrJ|jjsJdSn|jS(N(RRttoptwakeuptPyShelltbeginR(R4R\((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR=:s  N(RRRR1RRRRR=(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR1stModifiedColorDelegatorcBs2eZdZdZdZdZdZRS(s8Extend base class: colorizer for the shell window itselfcCstj||jdS(N(RR7t LoadTagDefs(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR7Hs cCs7|jddd|jdddtj|dS(NtTODOs1.0tiomarktSYNC(R^RNRtrecolorize_main(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRLscCstj|tjddd}|jjiidd6dd6d6tj|dd6tj|dd6tj|d d 6dS( NtmaintThemetnamet backgroundt foregroundtstdintstdouttstderrtconsole(RRR t GetOptionttagdefsR,Rt GetHighlight(R4ttheme((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRQs  cCs+x$|jD]}|j|ddq WdS(NRR(RR^(R4ttag((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt removecolors[s(RRRR7RRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyREs    tModifiedUndoDelegatorcBs&eZdZddZddZRS(s;Extend base class: forbid insert/delete before the I/O markcCs[y-|jj|ddr,|jjdSWntk r@nXtj||||dS(NttspawnvtP_NOWAITRt executabletrpcpid(R4RF((s+/usr/local/lib/python2.7/idlelib/PyShell.pytspawn_subprocesss 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( Rt warnoptionsRQR RRnRtplatformRRkR(R4RRbt del_exitftcommandtdecorated_exec((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs   " cCst|jf}x\tdD]@}tj|yt||_PWqtjk r[}qXqW|j dS|jj j d|_t dkr|jj jtjtjdn|j|jj jdy|jjWn!tjk r}|jdSX|jjd|j|jjd|jj|jjd|jj|jjd|jj|jjd |jj|jjd t|jjd ||jd t|j|jS( Niiii RRRRR<RRStwith_cwd( tHOSTRRttimetsleepRtrpcclttsocketterrortdisplay_port_binding_errorRtlistening_sockt getsocknameRt setsockoptt SOL_SOCKETt SO_REUSEADDRRt settimeouttacceptttimeouttdisplay_no_subprocess_errortregisterRRRRR<Rt transfer_pathRotpoll_subprocess(R4taddrRURv((s+/usr/local/lib/python2.7/idlelib/PyShell.pytstart_subprocesss>      cCs|jr|jSt|_|j}|rLytj|jWqLqLXn|jj|j|j}|j }t |_ |j y|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 iiRcs RESTART trestarttleft(!RRRot getdebuggerRtclose_subprocess_debuggertclosetunix_terminateRt executingRnRRRRRRRt stop_readlineR8RRt showpromptRZtwidthtmark_sett mark_gravitytrestart_subprocess_debuggertload_breakpointsRRRR(R4RRVRt was_executingRvthalfbartgui((s+/usr/local/lib/python2.7/idlelib/PyShell.pytrestart_subprocesssJ                cCs|jjdddidS(Ntexectinterrupt_the_server((Rt remotecall(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt__request_interruptscCstjd|jjdS(Nttarget(t threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pytinterrupt_subprocessscCsp|jdk r(|jjj|jny|jjWntk rLnX|jt |j_ d|_dS(N( t_afteridRRR8t after_cancelRRR RRnR(R4((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>RRRtOSErrortwaitpid(R4((s+/usr/local/lib/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(R4RR?((s+/usr/local/lib/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|j|_ndS(Ntwaitg?tOKt EXCEPTIONs<>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR: (RRt pollresponset active_seqRR!tKeyboardInterruptRtclosingRt resetoutputRtreprtgetvartremote_stack_viewerRt __stderr__t endexecutingR R8taftert pollintervalRR(R4tclttresponsethowtwhatRterrmsg((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR0s@              cCs ||_dS(N(RT(R4RT((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt setdebuggerXscCs|jS(N(RT(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR[scCs|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(RR8RR(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pytopen_remote_stack_viewer^s c Csddlm}|jjdddi}|dkrK|jjjdS|j|j|}ddl m }m }t |jj}t jddd }t j|d d }||d |d d} | jjdddd|| jd|} | jdS(Ni(tRemoteObjectBrowserRt stackviewerR<(tScrolledCanvastTreeNodeRRRtnormalRtbgthighlightthicknessitexpanditfilltboth(sflist(tidlelibR#Rt remotequeueRRRmRYtStubObjectTreeItemtidlelib.TreeWidgetR%R&tToplevelR RRtframetpacktcanvasR*( R4R#toidtitemR%R&RRRtsctnode((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRks icCs#|j|}|j||dS(s1Like runsource() but assumes complete exec sourceN(t stuffsourcetexecfile(R4tsourceR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt execsource~scCs|dkr$t|dj}nyt||d}Wnattfk r|jj|jj}|dIJ|dIJt j |||jj nX|j |dS(sExecute an existing fileRaRs *** Error in script or command! s"Traceback (most recent call last):N( RRgtreadRt OverflowErrort SyntaxErrorRRRRtshowsyntaxerrorRtruncode(R4RR;tcodettkerr((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR:s     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(R9tmoreR%tfiltersRtfilterwarningst SyntaxWarningt isinstancettypest UnicodeTypeR-REtencodetencodingt UnicodeErrorRRRRt runsourceR(R4R;RRE((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRPs"      cCsSd|j}|jd|_|jd}t|dd||ftj|<|S(s"Stuff source in the filename caches is i(tgidtsplitRzRR)(R4R;RRt((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR9s  #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 (R4R((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( RR8t unpackerrorRNtseetgett IDENTCHARSRRRkRR@R( R4RR8tstufftmsgRtoffsetRtpostchar((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR@s$      c Cstj\}}}|tk}|rey+|\}\}}}} |sQd}nWqed}qeXn|r{|||| fSdSdS(Ni(Rtexc_infoR?R( R4RtvaluettbtokRYtdummy_filenameRRZR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRTs   cCsJ|jj|jtj||jjdrF|jjndS(s1Extend base class method to reset output properlys<>N(RRtchecklinecacheRt showtracebackRtopen_stack_viewer(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRcs    cCsFtj}x6|jD](}|d |ddkr||=qqWdS(Niis<>(RR)tkeys(R4tcR/((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRbs cBsQ|jjr|jdS|jrB|jjdd|fin ||jUdS(s*Run the code without invoking the debuggeriRRAi(RRtdisplay_executing_dialogRR.R(R4RB((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR s    cBs|jjr|jjn|j|jd k rN|jej(d |_n|j }z;yr|jj | r|j d k r|j j 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 methodRRAsExit?sDo you want to exit altogether?Rtyestmasters IDLE internal error in runcode()RN(RRRSRRbRRR%RGRTtbeginexecutingRt asyncqueueRtrunRt SystemExitRRptaskyesnoR8Rctuse_subprocessRRtcanceledRnR (R4RBRT((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRAsR              cCs|jjj|dS(sOverride base class methodN(RRR(R4R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR4scCs 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.Ri(RpRqRR8(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR8scCs 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.Ri(RpRqRR8(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRCscCs tjddd|jjdS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Ri(RpRqRR8(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRgKsN((RRR7RRRRRRRRnRRRRRRRRRTR!RR"RRQR<R:RPR9RSR@RTRcRbR RARRRRg(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR}sH    + .     &            1  RcBseZdedZeZeZd5d6d7d8d9d:gZe j dkrWd;edsPython s ShellR"t_Fileteditt_EditRVt_Debugtoptionst_Optionstwindowst_Windowsthelpt_Helptdarwint_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_llitwrapR\s<>s<>s<>s<>s<>s<>s<>s<>s<>i(RERRRRi2(sshellR(,Rot menu_specsRXRRSRtTkRtwithdrawRR R7Rotusetabst indentwidthtcontext_use_ps1R8t configureR9tenter_callbacktlinefeed_callbacktcancel_callbackt eof_callbackRdttoggle_debuggerttoggle_jit_stack_viewertview_restart_markt restart_shellRRt save_stdoutRt save_stderrRt save_stdinR-REtPseudoInputFileRNtPseudoOutputFileRR}thistoryR(R4R<tmsRmR8RE((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR7lsP              cCstjdtS(Nt shell_only(R t GetExtensionsRo(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pytget_standard_extension_namesscCs |adS(N(R(R4tstream((s+/usr/local/lib/python2.7/idlelib/PyShell.pytset_warning_streamscCstS(N(R(R4((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 idleRitbreak( RRpRqR8tset_debugger_indicatorRSRtclose_debuggert open_debugger(R4R\tdb((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs     cCs%|jj}|jd| dS(Ns<>(RSRtsetvar(R4R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCsdS(N((R4R\((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>>> (RSRR!RRRRtclose_remote_debuggerRRRRtps1RR(R4R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs     cCsq|jjr'tj|jj|}ntj|}|jj||jdt_|j |j dS(Ns[DEBUG ON] >>> ( RSRRtstart_remote_debuggerR R!RRRRR(R4tdbg_gui((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs     cCs|jd|_dS(sHelper for ModifiedInterpreteriN(RR(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRjs cCs d|_d|_|jdS(sHelper for ModifiedInterpreteriN(RRpR(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs  cCsf|jr=tjddddd|j}|tkr=dSn|jt|_t|_t j |S(sExtend EditorWindow.close()sKill?s6The program is still running! Do you want to kill it?RR`Rftcancel( RRpt askokcancelR8RnRRoRpRRR(R4R((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(RRoRSRRRRRRRRRRR<RRRRR(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs        cCstS(s8Override EditorWindow method: never remove the colorizer(Ro(R4R((s+/usr/local/lib/python2.7/idlelib/PyShell.pytispythonsourcescCs|jS(N(t shell_title(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyt short_title ss@Type "copyright", "credits" or "license()" for more information.cCs|jtr<d}|jj}|sB|jtSnd}|jdtjtj |j |f|j ddl }d|_tS(NR s==== No Subprocess ====sPython %s on %s %s %si(RRoRSRRRnRRtversionRt COPYRIGHTRtTkinterRt _default_rootRo(R4tnosubtclientR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs      cCs'|js dSt|_|jjdS(N(treadingRot_stop_readline_flagRtquit(R4((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|jr d|_d}n|S( NiR Rsend-1cis i(RE(RRtmainloopRRnR8RVRzRJtunicodeR-RERMRNRORRpRoRt endoffile(R4R.RRE((s+/usr/local/lib/python2.7/idlelib/PyShell.pytreadline(s4              cCstS(N(Ro(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pytisattyEscCsy |jjdddrdSWnnX|jp9|jsd|j|jjd|jdSd|_d|_ |jr|jj r|jj r|jj q|jj n|jr|jjndS(Ns sel.firsts!=ssel.lastsKeyboardInterrupt Rii(R8RRRRRSRRRRpRRRRRR(R4R\((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRHs&     cCs|jr|j rdS|jjdddoD|jjdddsKdS|jsk|j|jnd|_d|_|jj dS(NRs==RXsend-1ciiR( RRR8RRRRpRRR(R4R\((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR^s      cCs@|jr/|jjdd|jjdn |j|dS(NRXs R(RR8RXRUtnewline_and_indent_event(R4R\((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRms   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 |d rK|j|jj|d |d |dS|jjdd}|r|jj|d ddr|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<=RRRXRsiomark linestartRiisinsert lineends>=Rsinsert linestartsend-1csend-1c linestarts (RRR8RVRtrecallt tag_prevranget tag_nextrangeRRRRRXRURNtupdate_idletasksRRtrunit(R4R\tseltprevtnexttindicesR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRvsX "'"'&      cCstjdd|}tjdd|}|jd}|jjz@|jjddd|jjdd |jjd d}|jj d r|j ||jjd d}n|jj d|d j t |d krtjd|d jd }tjd|jd }xX|d D]I}|j|ra||t |}n|jj dd|jq5WnWd|jjd|jjXdS(Ns^\s*\nR s\n\s*$s Rs1.0RRXsend-1csinsert linestartt:iis ^([ \t]*)(tretsubRRR8tundo_block_startR^RRVtrstriptendswithRRXRRztsearchtgroupRiRUtundo_block_stop(R4RR\Rttprefixtorig_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 (R8RVRzRSRP(R4RRURF((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs #  # cCsq|jjr|jjSy tjWn!tjddd|jdSXddlm }||j |j }dS(NsNo stack traces@There is no stack trace yet. (sys.last_traceback is not defined)Rii(t StackBrowser( RSRRRtlast_tracebackRpRqR8tidlelib.StackViewerRRmR<(R4R\Rtsv((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRds     cCs$|jjd|jjddS(NRR(R8RU(R4R\((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCs|jjdtdS(s&Callback for Run/Restart Shell Cntl-F6RN(RSRRo(R4R\((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRscCsk|jyttj}Wn d}nX|jj||jjdd|j|j j dS(NR RXsend-1c( RRkRRRRR8Rtset_line_and_columnRCt reset_undo(R4R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs   cCs|jjdd}|jr1|jj|n|jjddkr_|jjddn|jjdd|jdtj_ dS(NRsend-1csend-2cs i( R8RVRtstoreRXRRRRt softspace(R4R;((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs  cCsry@|jjddtj|||d|jjddWnnX|jrnd|_tsntqnndS(NRtrightRi(R8RR RRpRoR(R4RR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs  cCsHy |jjdddrdSWntk r4dSXtt|jS(Ns sel.firstRRtdisabled(R8RRtsuperRRH(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRHs  cCs/|jjdddrdStt|jS(NRXRRR(R8RRRRL(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRLs(sfileRq(RrRs(sdebugRt(RuRv(RwRx(shelpRz(RwR|N((7RRRRRRRRRRRtidlelib.IdleHistoryR}RR7RRnRRRpRRRRRRRRRRRjRRRRRRRRRRRRRRRRRdRRRRRRHRL(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRSsh   2                   ?      t PseudoFilecBs;eZddZedZedZdZRS(cCs(||_||_d|_||_dS(Ni(R~RRt _encoding(R4R~RRN((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR7#s   cCs|jS(N(R(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRN)scCs d|jS(Ns<%s>(R(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR-scCstS(N(Ro(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR1sN(RRRR7tpropertyRNRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR!s RcBseZdZdZRS(cCstS(N(Ro(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pytwritable7scCs|jrtdnt|tttfkrt|trZtj|dd}qt|tr{tj |}qt|trtj |}qt dt|j n|j j ||jS(Nswrite to closed filesmust be string, not (tclosedRPRRRkt bytearrayRJt __getslice__Rt__str__t TypeErrorRR~RR(R4R((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR:s (RRRR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR5s RcBs>eZddZdZddZddZdZRS(cCs#tj||||d|_dS(NR (RR7t _line_buffer(R4R~RRN((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR7LscCstS(N(Ro(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pytreadablePsicCs|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 R i( RRPRRJRZRRRRRoR~RRz(R4tsizetresultR((s+/usr/local/lib/python2.7/idlelib/PyShell.pyR=Ss,         cCs|jrtdn|dkr-d}n+t|tsXtdt|jn|jpm|j j }|dkrt |}n|j dd|}|dkr|d}n|||_|| S(Nsread from closed fileismust be int, not is i( RRPRRJRZRRRRR~RRztfind(R4RRteol((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRjs       cCs|jjdS(N(R~R(R4((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRzsN(RRRR7RR=RR(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRJs     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]. cCstttat}t}t}d}d}t}y#tjtjdd\}}WnMtjk r}tj j dt |tj j t tj dnXx.|D]&\} } | dkr| }t}n| dkrt}t}n| dkrt}n| dkr.tjj t tj n| d krCt}n| d krXtan| d kr| }tjj|rnd G|GHtj t}n| d krt}t}n| dkr| t_t}qqW|r|ddkrtjj}t}nx=tttjD]&} tjjtj| tj| |q|r|j;j?||j;j<|qn5|rt-j@t }|r|j;j=d,|qnxt,jArt jBqWt jCttdS(.Nis c:deihnr:st:s Error: %s is-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-R RRseditor-on-startupRRt classNametIdletIconstWindowssidle.icoRg!@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(RoRoRnRtgetoptRtargvRRRRkt usage_msgtexitRR>R?RxRRRR=RRztabspathRQtdirnameRXtgetcwdR RRRmR@t__file__Rt wm_iconbitmapt TkVersiont PhotoImagettktcallRRRR<RtsetupAppRgR]tnewR=tisAquaTktdictRtlowerRRRtenvironRVRSR:R R<RSttkVersionWarningt inversedictRtdestroy(t enable_shellt enable_editRVtcmdtscripttstartuptoptsRFRYtotaRUtpathxRtdirt edit_startticondirticonfiletextRt iconfilesticonsR~ttkversionwarning((s+/usr/local/lib/python2.7/idlelib/PyShell.pyRs #                      $      ! /"%           R(LR>tos.pathRRRRRRRt tracebackRKRCRRBRRRRRt ImportErrorRRRptidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorRtidlelib.UndoDelegatorRtidlelib.OutputWindowR tidlelib.configHandlerR R-R R R RRt ascii_letterstdigitsRWRRtsignalRRR%RRR#R$R(Rot checkcacheR0R1RRRt RPCClientRRRt TextIOBaseRRRRRRRRn(((s+/usr/local/lib/python2.7/idlelib/PyShell.pyts                       g