,Rc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZddlmZyddlTWn+ek rejdIJejdnXddlZddlmZmZddlmZdd lmZdd lmZdd lm 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/nXeja0ddl1Z1e2dZ3e2e2dZ4e2a5dZ6e6e7e2e j8dZ9e9e _8defdYZ:defdYZ;defd YZ<d!efd"YZ=d#e%j>fd$YZ?d%efd&YZ@d'e fd(YZAd)e jBfd*YZCd+eCfd,YZDd-eCfd.YZEd/ZFd0ZGeHd1krejId1ejId'>> N(Rtwarning_streamtwriteRtAttributeErrortIOError(RRRRtfileR((s0/opt/freeware/lib64/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((s0/opt/freeware/lib64/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((s0/opt/freeware/lib64/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((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytfilename_changed_hooks (t breakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt open_shelltostpathtjoinR t GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR1(R3targsR4((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR6s     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( R7RBRttag_addR5tindext ValueErrortappendR;tpyshelltinterptdebuggerR9(R3RR7Rtitdebug((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytset_breakpoints   cCsU|j}|jj}|s)|jdStt|jd}|j|dS(Ntinsert(R7RBRtbelltinttfloatRNRV(R3teventR7RR((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR9s   cCs|j}|jj}|s)|jdStt|jd}y|jj|WnnX|j dddy&|j j j j }|j||WnnXdS(NRWRLsinsert linestartsinsert lineend +1char(R7RBRRXRYRZRNR5tremovet tag_removeR;RQRRRSR:(R3R[R7RRRU((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR:s"    cCs|jr~|j}|jj}|s2|jdSg|_|jddty#|jjj j }|j |Wq~q~XndS(NRLs1.0( R5R7RBRRXR]tENDR;RQRRRStclear_file_breaks(R3R7RRU((s0/opt/freeware/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(R5RBRtopenRAt readlinesR t startswithRtupdate_breakpointststrtgetattrtroottFalsetTrueRct tkMessageBoxt showerrorR7(R3tbreaksRtold_filetlinestnew_fileRterr((s0/opt/freeware/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`Rbi(R7R+RBRRR=R>tisfileRARfRgRhtevaltlenRV(R3RRsRtbreakpoint_linenumberstbreakpoint_linenumber((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR1s     cCs4|j}|jd}|j|}||_dS(s3Retrieves all the breakpoints in the current windowRLN(R7t tag_rangestranges_to_linenumbersR5(R3R7trangestlinenumber_list((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRis cCsg}xtdt|dD]f}tt||j}tt||dj}x'||kr|j||d7}q^WqW|S(Niii(trangeRyRYRZtstringRP(R3R~RsRNRtend((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR}s cCs|jtj|dS(s7Extend base method - clear breaks when module is closedN(R_Rt_close(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR+s (RFs<>srmenu_check_cut(RHs<>RI(RJs <>srmenu_check_pasteN(sSet Breakpoints<>N(sClear Breakpoints<>N(Rt __module__t__doc__R6Rt rmenu_specsRVR9R:R_RvR1RiR}R(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR0~s       /   tPyShellFileListcBs&eZdZeZdZddZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjn.t||_|jrJ|jjsJdSn|jS(N(RQttoptwakeuptPyShelltbeginR(R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR<:s  N(RRRR0RRRQR<(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR1stModifiedColorDelegatorcBs2eZdZdZdZdZdZRS(s8Extend base class: colorizer for the shell window itselfcCstj||jdS(N(RR6t LoadTagDefs(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR6Hs cCs7|jddd|jdddtj|dS(NtTODOs1.0tiomarktSYNC(R]RMRtrecolorize_main(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRLscCstj|tjddd}|jjiidd6dd6d6tj|dd6tj|dd6tj|d d 6dS( NtmaintThemetnamet backgroundt foregroundtstdintstdouttstderrtconsole(RRR t GetOptionttagdefsR+Rt GetHighlight(R3ttheme((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRQs  cCs+x$|jD]}|j|ddq WdS(NRR(RR](R3ttag((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyt removecolors[s(RRRR6RRR(((s0/opt/freeware/lib64/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(Nt      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 iiRbs RESTART trestarttleft(!RRRnt getdebuggerR tclose_subprocess_debuggertclosetunix_terminateRt executingRmRRRRRRRt stop_readlineR7RRt showpromptRYtwidthtmark_sett mark_gravitytrestart_subprocess_debuggertload_breakpointsRRRR(R3RRURt was_executingRuthalfbartgui((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytrestart_subprocesssJ                cCs|jjdddidS(Ntexectinterrupt_the_server((Rt remotecall(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyt__request_interruptscCstjd|jjdS(Nttarget(t threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytinterrupt_subprocessscCsp|jdk r(|jjj|jny|jjWntk rLnX|jt |j_ d|_dS(N( t_afteridRRR7t after_cancelRRRRRmR(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytkill_subprocesss   cCsnttdrjytj|jtWntk r:dSXytj|jdWqjtk rfdSXndS(s;UNIX: make sure subprocess is terminated and collect statustkillNi(thasattrR=RRRtOSErrortwaitpid(R3((s0/opt/freeware/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(R3RR>((s0/opt/freeware/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|j|_ndS(Ntwaitg?tOKt EXCEPTIONs<>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR: (RRt pollresponset active_seqRR tKeyboardInterruptRtclosingRt resetoutputRtreprtgetvartremote_stack_viewerRt __stderr__t endexecutingRR7taftert pollintervalRR(R3tclttresponsethowtwhatRterrmsg((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR0s@              cCs ||_dS(N(RS(R3RS((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyt setdebuggerXscCs|jS(N(RS(R3((s0/opt/freeware/lib64/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(RR7RR(R3((s0/opt/freeware/lib64/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 remotequeueRRRlRXtStubObjectTreeItemtidlelib.TreeWidgetR%R&tToplevelR RRtframetpacktcanvasR*( R3R#toidtitemR%R&RRRtsctnode((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRks icCs#|j|}|j||dS(s1Like runsource() but assumes complete exec sourceN(t stuffsourcetexecfile(R3tsourceR((s0/opt/freeware/lib64/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 fileR`Rs *** Error in script or command! s"Traceback (most recent call last):N( RRftreadRt OverflowErrort SyntaxErrorRRRRtshowsyntaxerrorRtruncode(R3RR;tcodettkerr((s0/opt/freeware/lib64/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(R3R;RRE((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRPs"      cCsSd|j}|jd|_|jd}t|dd||ftj|<|S(s"Stuff source in the filename caches is i(tgidtsplitRyRR((R3R;RRs((s0/opt/freeware/lib64/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 (R3R((s0/opt/freeware/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 charsRs wordstartsSyntaxError: %s N( RR7t unpackerrorRMtseetgett IDENTCHARSRRRjRR@R( R3RR7tstufftmsgRtoffsetRtpostchar((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR@s$      c Cstj\}}}|tk}|rey+|\}\}}}} |sQd}nWqed}qeXn|r{|||| fSdSdS(Ni(Rtexc_infoR?R( R3RtvaluettbtokRYtdummy_filenameRRZR((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRTs   cCsJ|jj|jtj||jjdrF|jjndS(s1Extend base class method to reset output properlys<>N(RRtchecklinecacheRt showtracebackRtopen_stack_viewer(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRcs    cCsFtj}x6|jD](}|d |ddkr||=qqWdS(Niis<>(RR(tkeys(R3tcR.((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRbs cBsQ|jjr|jdS|jrB|jjdd|fin ||jUdS(s*Run the code without invoking the debuggeriRRAi(RRtdisplay_executing_dialogRR.R(R3RB((s0/opt/freeware/lib64/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(RRRRRRbRRR$RGRStbeginexecutingRt asyncqueueRtrunRt SystemExitRRotaskyesnoR7Rctuse_subprocessRRtcanceledRmR(R3RBRS((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRAsR              cCs|jjj|dS(sOverride base class methodN(RRR(R3R((s0/opt/freeware/lib64/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(RoRpRR7(R3((s0/opt/freeware/lib64/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(RoRpRR7(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRCscCs tjddd|jjdS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Ri(RoRpRR7(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRgKsN((RRR6RRRRRRRRmRRRRRRRRRSR!RR"RRQR<R:RPR9RSR@RTRcRbR RARRRRg(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR}sH    + .     &            1  RcBseZdedZeZeZd4d5d6d7d8d9gZe j rTd:ed>s<>s<>s<>s<>s<>s<>s<>s<>i(RERRRRi2(sshellR~(,Rot menu_specsRWRRRRtTkRtwithdrawRRR6Rntusetabst indentwidthtcontext_use_ps1R7t configureR8tenter_callbacktlinefeed_callbacktcancel_callbackt eof_callbackRdttoggle_debuggerttoggle_jit_stack_viewertview_restart_markt restart_shellRRt save_stdoutRt save_stderrRt save_stdinR-REtPseudoInputFileRNtPseudoOutputFileRR|thistoryR(R3R;tmsRlR7RE((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR6lsP              cCstjdtS(Nt shell_only(R t GetExtensionsRn(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytget_standard_extension_namesscCs |adS(N(R(R3tstream((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytset_warning_streamscCstS(N(R(R3((s0/opt/freeware/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 idleRitbreak( RRoRpR7tset_debugger_indicatorRRRtclose_debuggert open_debugger(R3R[tdb((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs     cCs%|jj}|jd| dS(Ns<>(RRRtsetvar(R3R((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRscCsdS(N((R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRscCs|jj}|r|jjd|j|jjrQtj|jjn|j|j j ddt _ |j n|jdS(Ns [DEBUG OFF] s>>> (RRRR!RRRR tclose_remote_debuggerRRRRtps1RR(R3R((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs     cCsq|jjr'tj|jj|}ntj|}|jj||jdt_|j |j dS(Ns[DEBUG ON] >>> ( RRRR tstart_remote_debuggerR R!RRRRR(R3tdbg_gui((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs     cCs|jd|_dS(sHelper for ModifiedInterpreteriN(RR(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRjs cCs d|_d|_|jdS(sHelper for ModifiedInterpreteriN(RRpR(R3((s0/opt/freeware/lib64/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`Retcancel( RRot askokcancelR7RmRRnRpRRR(R3R((s0/opt/freeware/lib64/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(RRoRRRRRRRRRRRRR;RQRRR(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs        cCstS(s8Override EditorWindow method: never remove the colorizer(Rn(R3R((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytispythonsourcescCs|jS(N(t shell_title(R3((s0/opt/freeware/lib64/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(RRoRRRRRmRRtversionRt COPYRIGHTRtTkinterRt _default_rootRn(R3tnosubtclientR((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs      cCs'|js dSt|_|jjdS(N(treadingRnt_stop_readline_flagRtquit(R3((s0/opt/freeware/lib64/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(RRtmainloopRRmR7RVRyRJtunicodeR-RERMRNRORRpRoRt endoffile(R3R-RRE((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytreadline(s4              cCstS(N(Rn(R3((s0/opt/freeware/lib64/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(R7RRRRRRRRRRpRRRRRR(R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRHs&     cCs|jr|j rdS|jjdddoD|jjdddsKdS|jsk|j|jnd|_d|_|jj dS(NRs==RWsend-1ciiR( RRR7RRRRpRRR(R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR^s      cCs@|jr/|jjdd|jjdn |j|dS(NRWs R(RR7RWRUtnewline_and_indent_event(R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRms   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 |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<=RRRWRsiomark linestartRiisinsert lineends>=Rsinsert linestartsend-1csend-1c linestarts (RRR7RVRtrecallt tag_prevranget tag_nextrangeRRRRRWRURMtupdate_idletasksRRtrunit(R3R[tseltprevtnexttindicesR((s0/opt/freeware/lib64/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.0RRWsend-1csinsert linestartt:iis ^([ \t]*)(tretsubRRR7tundo_block_startR]RRVtrstriptendswithRRWRRytsearchtgroupRhRUtundo_block_stop(R3RR[Rstprefixtorig_base_indenttnew_base_indentR((s0/opt/freeware/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 (R7RVRyRRRP(R3RRTRF((s0/opt/freeware/lib64/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( RRRRRtlast_tracebackRoRpR7tidlelib.StackViewerRRlR;(R3R[Rtsv((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRds     cCs$|jjd|jjddS(NRR(R7RU(R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRscCs|jjdtdS(s&Callback for Run/Restart Shell Cntl-F6RN(RRRRn(R3R[((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRscCsk|jyttj}Wn d}nX|jj||jjdd|j|j j dS(NR RWsend-1c( RRjRRRRR7Rtset_line_and_columnRBt reset_undo(R3R((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs   cCs|jjdd}|jr1|jj|n|jjddkr_|jjddn|jjdd|jdtj_ dS(NRsend-1csend-2cs i( R7RVRtstoreRWRRRRt softspace(R3R;((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs  cCsry@|jjddtj|||d|jjddWnnX|jrnd|_tsntqnndS(NRtrightRi(R7RRRRpRoR(R3RR((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs  cCsHy |jjdddrdSWntk r4dSXtt|jS(Ns sel.firstRRtdisabled(R7RRtsuperRRG(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRGs  cCs/|jjdddrdStt|jS(NRWRRR(R7RRRRK(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRKs(sfileRq(RrRs(sdebugRt(RuRv(RwRx(shelpRz(RwR{N((7RRRRRRRRRRtrunningAsOSXApptidlelib.IdleHistoryR|RR6RRmRRRpRRRRRRRRRRRjRRRRRRRRRRRRRRRRRdRRRRRRGRK(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRSsh    2                   ?      t PseudoFilecBs;eZddZedZedZdZRS(cCs(||_||_d|_||_dS(Ni(R}RRt _encoding(R3R}RRN((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR6#s   cCs|jS(N(R(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRN)scCs d|jS(Ns<%s>(R(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR-scCstS(N(Rn(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR1sN(RRRR6tpropertyRNRR(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR!s RcBseZdZdZRS(cCstS(N(Rn(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytwritable7scCs_|jrtdnt|ttfsItdt|jn|jj ||j S(Nswrite to closed filesmust be string, not ( tclosedRORJt basestringt bytearrayt TypeErrorRRR}RR(R3R((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR:s  (RRRR(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR5s RcBs>eZddZdZddZddZdZRS(cCs#tj||||d|_dS(NR (RR6t _line_buffer(R3R}RRN((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR6DscCstS(N(Rn(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pytreadableHsicCs|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( RRORRJRYRRRRRnR}RRy(R3tsizetresultR((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyR=Ks,         cCs|jrtdn|dkr-d}n+t|tsXtdt|jn|jpm|j j }|dkrt |}n|||_|| S(Nsread from closed fileismust be int, not i( RRORRJRYRRRRR}RRy(R3RR((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRbs     cCs|jjdS(N(R}R(R3((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRosN(RRRR6RR=RR(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRBs     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| RwRRRR=RRytabspathRPtdirnameRWtgetcwdR RRRlRRRR;RtsetupAppRfR\tnewR<RtdictRtlowerRQRtenvironRVRRR:R R<RSttkVersionWarningR?t inversedictRtdestroy(t enable_shellt enable_editRUtcmdtscripttstartuptoptsRERYtotaRTtpathxRtdirt edit_startR}ttkversionwarning((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyRs #                      $              %  R(KR=tos.pathRRRRRRRt tracebackRKRBRRBRRRRt ImportErrorRRRotidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorRtidlelib.UndoDelegatorRtidlelib.OutputWindowRtidlelib.configHandlerR R-R R R R Rt ascii_letterstdigitsRWRRtsignalRRR$RRR"R#R'Rnt checkcacheR/R0RRRt RPCClientRRRt TextIOBaseRRRRRRRRm(((s0/opt/freeware/lib64/python2.7/idlelib/PyShell.pyts                        d