kWc@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZyddlTWn1ek reddejejdnXddlZdd lmZmZdd lmZdd lm Z dd l!m"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/dZ0dZ1yddl2m3Z3Wnek r#dZ3nXeja4ddl5Z5e6dZ7e6e6dZ8e6a9dZ:e:e;e6ej<dZ=e=e_<defdYZ>defd YZ?d!e fd"YZ@d#e"fd$YZAd%e)jBfd&YZCd'efd(YZDd)e$fd*YZEd+e jFfd,YZGd-eGfd.YZHd/eGfd0YZId1ZJd2ZKeLd3krejMd3ejMd)>> N(Rtwarning_streamtwriteRtAttributeErrortIOError(RRRRRR((s%/usr/lib/python2.7/idlelib/PyShell.pytidle_showwarningFs   cCsL|r*tdkrHtjatt_qHntdk rHtt_dandS(s>Replace warning.showwarning with idle_showwarning, or reverse.N(t_warnings_showwarningRtwarningst showwarningR$(tcapture((s%/usr/lib/python2.7/idlelib/PyShell.pytcapture_warningsYs    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/lib/python2.7/idlelib/PyShell.pytextended_linecache_checkcachehs  tPyShellEditorWindowcBseZdZdZdddddgZedZdZddZ ddZ dZ dZ dZ dZdZdZRS(s6Regular text edit window in IDLE, supports breakpointscGsg|_tj|||jjd|j|jjd|j|jjd|jjt j j t j d|_|jj|d}|jj||jjr|jn|jdS(Ns<>s<>s<>sbreakpoints.lstcSs|j|dS(N(trestore_file_breaks(told_hooktself((s%/usr/lib/python2.7/idlelib/PyShell.pytfilename_changed_hooks (t breakpointsRt__init__ttexttbindtset_breakpoint_heretclear_breakpoint_heretflistt open_shelltostpathtjoinR t GetUserCfgDirtbreakpointPathtiotfilename_change_hooktset_filename_change_hookRR3tcolor_breakpoint_text(R5targsR6((s%/usr/lib/python2.7/idlelib/PyShell.pyR8s      tCuts<>trmenu_check_cuttCopys<>trmenu_check_copytPastes <>trmenu_check_pastesSet Breakpoints<>sClear Breakpoints<>cCsn|jdkrdS|rCtjddd}tj|d}nidd6dd6}|jjd |dS( s,Turn colorizing of breakpoint text on or offNtmaintThemetnametbreaktt foregroundt backgroundtBREAK(RDRR t GetOptiont GetHighlightR9t tag_config(R5tcolortthemetcfg((s%/usr/lib/python2.7/idlelib/PyShell.pyRGscCs|j}|jj}|jdd|d|dy|jj|}Wn!tk rm|jj|nXy&|jj j j }|j ||WnnXdS(NRVs%d.0i( R9RDRttag_addR7tindext ValueErrortappendR=tpyshelltinterptdebuggerR;(R5RR9Rtitdebug((s%/usr/lib/python2.7/idlelib/PyShell.pytset_breakpoints   cCsU|j}|jj}|s)|jdStt|jd}|j|dS(Ntinsert(R9RDRtbelltinttfloatR^Rf(R5teventR9RR((s%/usr/lib/python2.7/idlelib/PyShell.pyR;s   cCs|j}|jj}|s)|jdStt|jd}y|jj|WnnX|j dddy&|j j j j }|j||WnnXdS(NRgRVsinsert linestartsinsert lineend +1char(R9RDRRhRiRjR^R7tremovet tag_removeR=RaRbRcR<(R5RkR9RRRe((s%/usr/lib/python2.7/idlelib/PyShell.pyR<s"    cCs|jr~|j}|jj}|s2|jdSg|_|jddty#|jjj j }|j |Wq~q~XndS(NRVs1.0( R7R9RDRRhRmtENDR=RaRbRctclear_file_breaks(R5R9RRe((s%/usr/lib/python2.7/idlelib/PyShell.pyRos     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_breakpointststrtgetattrtroottFalsetTrueRst tkMessageBoxt showerrorR9(R5tbreaksRtold_filetlinestnew_fileRterr((s%/usr/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(NRpRri(R9R-RDRRR?R@tisfileRCRvRwRxtevaltlenRf(R5RRRtbreakpoint_linenumberstbreakpoint_linenumber((s%/usr/lib/python2.7/idlelib/PyShell.pyR3 s     cCs4|j}|jd}|j|}||_dS(s3Retrieves all the breakpoints in the current windowRVN(R9t tag_rangestranges_to_linenumbersR7(R5R9trangestlinenumber_list((s%/usr/lib/python2.7/idlelib/PyShell.pyRys cCsg}xtdt|dD]f}tt||j}tt||dj}x'||kr|j||d7}q^WqW|S(Niii(trangeRRiRjtstringR`(R5RRR^Rtend((s%/usr/lib/python2.7/idlelib/PyShell.pyR#s cCs|jtj|dS(s7Extend base method - clear breaks when module is closedN(RoRt_close(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyR4s (RIs<>srmenu_check_cut(RKs<>RL(RMs <>srmenu_check_pasteN(sSet Breakpoints<>N(sClear Breakpoints<>N(Rt __module__t__doc__R8Rt rmenu_specsR~RGRfR;R<RoRR3RyRR(((s%/usr/lib/python2.7/idlelib/PyShell.pyR2s"      *   tPyShellFileListcBs&eZdZeZdZddZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjn.t||_|jrJ|jjsJdSn|jS(N(RattoptwakeuptPyShelltbeginR(R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyR>Cs  N(RRRR2RRRaR>(((s%/usr/lib/python2.7/idlelib/PyShell.pyR:stModifiedColorDelegatorcBs2eZdZdZdZdZdZRS(s8Extend base class: colorizer for the shell window itselfcCstj||jdS(N(R R8t LoadTagDefs(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyR8Qs cCs7|jddd|jdddtj|dS(NtTODOs1.0tiomarktSYNC(RmR]R trecolorize_main(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRUscCstj|tjddd}|jjiidd6dd6d6tj|dd6tj|dd6tj|d d 6dS( NRORPRQRURTtstdintstdouttstderrtconsole(R RR RWttagdefsR-RRX(R5R[((s%/usr/lib/python2.7/idlelib/PyShell.pyRZs  cCs+x$|jD]}|j|ddq WdS(NRR(RRm(R5ttag((s%/usr/lib/python2.7/idlelib/PyShell.pyt removecolorsds(RRRR8RRR(((s%/usr/lib/python2.7/idlelib/PyShell.pyRNs    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 iiRrs RESTART trestarttleft(!RRR~t getdebuggerRtclose_subprocess_debuggertclosetunix_terminateRt executingR}RRRRRRRt stop_readlineR9RR!t showpromptRitwidthtmark_sett mark_gravitytrestart_subprocess_debuggertload_breakpointsRRRR(R5RReRt was_executingRthalfbartgui((s%/usr/lib/python2.7/idlelib/PyShell.pytrestart_subprocesssJ                cCs|jjdddidS(Ntexectinterrupt_the_server((Rt remotecall(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyt__request_interrupt scCstjd|jjdS(Nttarget(t threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R5((s%/usr/lib/python2.7/idlelib/PyShell.pytinterrupt_subprocessscCsp|jdk r(|jjj|jny|jjWntk rLnX|jt |j_ d|_dS(N( t_afteridRRR9t after_cancelRRR"RR}R(R5((s%/usr/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/lib/python2.7/idlelib/PyShell.pyRs  cCsC|r"dg}|jtjn tj}|jd|fdS(NRSsRif 1: import sys as _sys _sys.path = %r del _sys (textendRR@t runcommand(R5RR@((s%/usr/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<>tERRORs/PyShell.ModifiedInterpreter: Subprocess ERROR: (RRt pollresponset active_seqRR#tKeyboardInterruptRtclosingRt resetoutputRtprinttreprtgetvartremote_stack_viewerRt __stderr__t endexecutingR"R9taftert pollintervalRR (R5tclttresponsethowtwhatRterrmsg((s%/usr/lib/python2.7/idlelib/PyShell.pyR9s@              cCs ||_dS(N(Rc(R5Rc((s%/usr/lib/python2.7/idlelib/PyShell.pyt setdebuggerascCs|jS(N(Rc(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRdscCs|jjjd|jdS(sInitiate the remote stack viewer from a separate thread. This method is called from the subprocess, and by returning from this method we allow the subprocess to unblock. After a bit the shell requests the subprocess to open the remote stack viewer which returns a static object looking at the last exception. It is queried through the RPC mechanism. i,N(RR9R"R(R5((s%/usr/lib/python2.7/idlelib/PyShell.pytopen_remote_stack_viewergs 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=(tScrolledCanvastTreeNodeRORPRQtnormalRUtbgthighlightthicknessitexpanditfilltboth(sflist(tidlelibR+Rt remotequeueRRR|RhtStubObjectTreeItemtidlelib.TreeWidgetR-R.tToplevelR RWRXtframetpacktcanvasR2( R5R+toidtitemR-R.RR[RUtsctnode((s%/usr/lib/python2.7/idlelib/PyShell.pyRts icCs#|j|}|j||dS(s1Like runsource() but assumes complete exec sourceN(t stuffsourcetexecfile(R5tsourceR((s%/usr/lib/python2.7/idlelib/PyShell.pyt execsourcescCs|dkr$t|dj}nyt||d}WnWttfk r|jjtdd|jj t j |||jj nX|j |dS(sExecute an existing fileRpRsB*** Error in script or command! Traceback (most recent call last):RN(RRvtreadRt OverflowErrort SyntaxErrorRRRRRtshowsyntaxerrorRtruncode(R5RRCtcode((s%/usr/lib/python2.7/idlelib/PyShell.pyRBs    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(RAtmoreR&tfiltersRtfilterwarningst SyntaxWarningt isinstancettypest UnicodeTypeR5RLtencodetencodingt UnicodeErrorRRR!Rt runsourceR(R5RCRRL((s%/usr/lib/python2.7/idlelib/PyShell.pyRWs"      cCsSd|j}|jd|_|jd}t|dd||ftj|<|S(s"Stuff source in the filename caches is i(tgidtsplitRRR*(R5RCRR((s%/usr/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/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( RR9t unpackerrorR]tseetgett IDENTCHARSRR!RzRRHR( R5RR9tstufftmsgRtoffsetRtpostchar((s%/usr/lib/python2.7/idlelib/PyShell.pyRHs$      c Cstj\}}}|tk}|rey+|\}\}}}} |sQd}nWqed}qeXn|r{|||| fSdSdS(Ni(Rtexc_infoRGR( R5RtvaluettbtokR`tdummy_filenameRRaR((s%/usr/lib/python2.7/idlelib/PyShell.pyR[s   cCsJ|jj|jtj||jjdrF|jjndS(s1Extend base class method to reset output properlys<>N(RRtchecklinecacheRt showtracebackRtopen_stack_viewer(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRjs    cCsFtj}x6|jD](}|d |ddkr||=qqWdS(Niis<>(RR*tkeys(R5tcR0((s%/usr/lib/python2.7/idlelib/PyShell.pyRis cBsQ|jjr|jdS|jrB|jjdd|fin ||jUdS(s*Run the code without invoking the debuggeriRRIi(RRtdisplay_executing_dialogRR6R(R5RJ((s%/usr/lib/python2.7/idlelib/PyShell.pyRs    cBs|jjr|jjn|j|jd k rN|jej(d |_n|j }zGyr|jj | r|j d k r|j j dd|fi|_ n'|r|j||jn ||jUWnek r%|jjsejddddd|jjrq"|jqnxer^edd |jj|j|jjq|jjre|j_ed d |jjq|jnXWd esy|jjWqek rqXnXd S( sOverride base class methodRRIsExit?sDo you want to exit altogether?Rtyestmasters IDLE internal error in runcode()RRN(RRRbRRiRRR&RNRctbeginexecutingRt asyncqueueRtrunRt SystemExitRRtaskyesnoR9Rjtuse_subprocessRRR!tcanceledR}R"(R5RJRc((s%/usr/lib/python2.7/idlelib/PyShell.pyRI sR               cCs|jjj|dS(sOverride base class methodN(RRR!(R5R((s%/usr/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.Rp(RRRR9(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRAscCs 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.Rp(RRRR9(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRLscCs tjddd|jjdS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Rp(RRRR9(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRnTsN((RRR8RR RRRRRR}RRR R RRRRRcR)RR*RRXRDRBRWRARZRHR[RjRiRRIR!RRRn(((s%/usr/lib/python2.7/idlelib/PyShell.pyRsH    + .     &            1  RcBseZdedZeZeZd5d6d7d8d9d:gZe j dkrWd;edsPython s ShellRt_Fileteditt_EditRet_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_llitwrapRcs<>s<>s<>s<>s<>s<>s<>s<>s<>i(RLRRRRi2(sshellR(,Rvt menu_specsRgRRbRtTkRtwithdrawRR R8R~tusetabst indentwidthtcontext_use_ps1R9t configureR:tenter_callbacktlinefeed_callbacktcancel_callbackt eof_callbackRkttoggle_debuggerttoggle_jit_stack_viewertview_restart_markt restart_shellRRt save_stdoutRt save_stderrRt save_stdinR5RLtPseudoInputFileRUtPseudoOutputFileRRthistoryR#(R5R=tmsR|R9RL((s%/usr/lib/python2.7/idlelib/PyShell.pyR8usP              cCstjdtS(Nt shell_only(R t GetExtensionsR~(R5((s%/usr/lib/python2.7/idlelib/PyShell.pytget_standard_extension_namesscCs |adS(N(R (R5tstream((s%/usr/lib/python2.7/idlelib/PyShell.pytset_warning_streamscCstS(N(R (R5((s%/usr/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 idleRpRR( RRRR9tset_debugger_indicatorRbRtclose_debuggert open_debugger(R5Rktdb((s%/usr/lib/python2.7/idlelib/PyShell.pyRs     cCs%|jj}|jd| dS(Ns<>(RbRtsetvar(R5R((s%/usr/lib/python2.7/idlelib/PyShell.pyRscCsdS(N((R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyRscCs|jj}|r|jjd|j|jjrQtj|jjn|j|j j ddt _ |j n|jdS(Ns [DEBUG OFF] s>>> (RbRR)RRRRtclose_remote_debuggerRRR!Rtps1RR(R5R((s%/usr/lib/python2.7/idlelib/PyShell.pyRs     cCsq|jjr'tj|jj|}ntj|}|jj||jdt_|j |j dS(Ns[DEBUG ON] >>> ( RbRRtstart_remote_debuggerRR)RRRRR(R5tdbg_gui((s%/usr/lib/python2.7/idlelib/PyShell.pyRs     cCs|jd|_dS(sHelper for ModifiedInterpreteriN(RR(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRqs cCs d|_d|_|jdS(sHelper for ModifiedInterpreteriN(RRwR(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyR!s  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?RRgRutcancel( RRt askokcancelR9R}RR~RwRRR(R5R%((s%/usr/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(RRvRbR RRRRRRRRRR=RaRRR(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRs        cCstS(s8Override EditorWindow method: never remove the colorizer(R~(R5R((s%/usr/lib/python2.7/idlelib/PyShell.pytispythonsourcescCs|jS(N(t shell_title(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyt short_titless@Type "copyright", "credits" or "license()" for more information.cCs|jtr<d}|jj}|sB|jtSnd}|jdtjtj |j |f|j ddl }d|_tS(NRSs==== No Subprocess ====sPython %s on %s %s %si(RRvRbRRR}R!RtversionRt COPYRIGHTRtTkinterRt _default_rootR~(R5tnosubtclientR((s%/usr/lib/python2.7/idlelib/PyShell.pyRs      cCs'|js dSt|_|jjdS(N(treadingR~t_stop_readline_flagRtquit(R5((s%/usr/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( NiRSRsend-1cis i(RL(RRtmainloopRR}R9R]RRQtunicodeR5RLRTRURVRRwRvRt endoffile(R5R/RRL((s%/usr/lib/python2.7/idlelib/PyShell.pytreadline1s4              cCstS(N(R~(R5((s%/usr/lib/python2.7/idlelib/PyShell.pytisattyNscCsy |jjdddrdSWnnX|jp9|jsd|j|jjd|jdSd|_d|_ |jr|jj r|jj r|jj q|jj n|jr|jjndS(Ns sel.firsts!=ssel.lastsKeyboardInterrupt RRii(R9RRRRRbR!RRRwRRRR RR(R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyRQs&     cCs|jr|j rdS|jjdddoD|jjdddsKdS|jsk|j|jnd|_d|_|jj dS(NRs==Rgsend-1ciiRR( RRR9RRRRwRRR(R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyRgs      cCs@|jr/|jjdd|jjdn |j|dS(NRgs RR(RR9RgR\tnewline_and_indent_event(R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyRvs   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<=RRRRgRsiomark linestartRiisinsert lineends>=Rsinsert linestartsend-1csend-1c linestarts (RRR9R]Rtrecallt tag_prevranget tag_nextrangeRRRRRgR\R]tupdate_idletasksRRtrunit(R5RktseltprevtnexttindicesR((s%/usr/lib/python2.7/idlelib/PyShell.pyRsX "'"'&      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*\nRSs\n\s*$s Rs1.0RRgsend-1csinsert linestartt:iis ^([ \t]*)(tretsubRYR9tundo_block_startRmRR]trstriptendswithRRgRRtsearchtgroupRxR\tundo_block_stop(R5RRkRtprefixtorig_base_indenttnew_base_indentR((s%/usr/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]RRbRW(R5RRdRM((s%/usr/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)Rpi(t StackBrowser( RbRRRtlast_tracebackRRR9tidlelib.StackViewerRR|R=(R5RkRtsv((s%/usr/lib/python2.7/idlelib/PyShell.pyRks     cCs$|jjd|jjddS(NRR(R9R\(R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyRscCs|jjdtdS(s&Callback for Run/Restart Shell Cntl-F6RN(RbRR~(R5Rk((s%/usr/lib/python2.7/idlelib/PyShell.pyRscCsk|jyttj}Wn d}nX|jj||jjdd|j|j j dS(NRSRgsend-1c( RRzRRRR!R9Rtset_line_and_columnRDt reset_undo(R5R((s%/usr/lib/python2.7/idlelib/PyShell.pyRs   cCs|jjdd}|jr1|jj|n|jjddkr_|jjddn|jjdd|jdtj_ dS(NRsend-1csend-2cs i( R9R]RtstoreRgRRRRt softspace(R5RC((s%/usr/lib/python2.7/idlelib/PyShell.pyRs  cCsry@|jjddtj|||d|jjddWnnX|jrnd|_tsntqnndS(NRtrightRi(R9RR R!RwRvR(R5RR((s%/usr/lib/python2.7/idlelib/PyShell.pyR!s  cCsHy |jjdddrdSWntk r4dSXtt|jS(Ns sel.firstRRtdisabled(R9RRtsuperRRJ(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRJs  cCs/|jjdddrdStt|jS(NRgRRR(R9RRRRN(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRN%s(sfileRx(RyRz(sdebugR{(R|R}(R~R(shelpR(R~RN((7RRRRRR RR RRRtidlelib.IdleHistoryRRR8RR}RRRwRRRRRRRRRRRqR!RRRRRRRRRRRRRRRRkRRRRR!RJRN(((s%/usr/lib/python2.7/idlelib/PyShell.pyR\sh   2                   ?      t PseudoFilecBs;eZddZedZedZdZRS(cCs(||_||_d|_||_dS(Ni(RRRt _encoding(R5RRRU((s%/usr/lib/python2.7/idlelib/PyShell.pyR8,s   cCs|jS(N(R(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRU2scCs d|jS(Ns<%s>(R(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRQ6scCstS(N(R~(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyR:sN(RRRR8tpropertyRURQR(((s%/usr/lib/python2.7/idlelib/PyShell.pyR*s RcBseZdZdZRS(cCstS(N(R~(R5((s%/usr/lib/python2.7/idlelib/PyShell.pytwritable@scCs|jrtdnt|tttfkrt|trZtj|dd}qt|tr{tj |}qt|trtj |}qt dt|j n|j j ||jS(Nswrite to closed filesmust be string, not (tclosedR_RRRzt bytearrayRQt __getslice__Rt__str__t TypeErrorRRR!R(R5R((s%/usr/lib/python2.7/idlelib/PyShell.pyR!Cs (RRRR!(((s%/usr/lib/python2.7/idlelib/PyShell.pyR>s RcBs>eZddZdZddZddZdZRS(cCs#tj||||d|_dS(NRS(RR8t _line_buffer(R5RRRU((s%/usr/lib/python2.7/idlelib/PyShell.pyR8UscCstS(N(R~(R5((s%/usr/lib/python2.7/idlelib/PyShell.pytreadableYsicCs|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 RSi( RR_RRQRiRRRRR~RRR(R5tsizetresultR((s%/usr/lib/python2.7/idlelib/PyShell.pyRE\s,         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( RR_RRQRiRRRRRRRtfind(R5RRteol((s%/usr/lib/python2.7/idlelib/PyShell.pyRss       cCs|jjdS(N(RR(R5((s%/usr/lib/python2.7/idlelib/PyShell.pyRsN(RRRR8RRERR(((s%/usr/lib/python2.7/idlelib/PyShell.pyRSs     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\}}Wn@tjk r}t d|t fdtj tj dnXx;|D]3\} } | dkr| }t}n| dkrt}t}n| dkrt}n| d kr!tj jt tj n| d kr6t}n| d krKtan| d kr| }tjj|rrn t d |dtj tj t}n| dkrt}t}n| dkr| t_t}qqW|r|ddkrtjj}t}nx=tttjD]&} tjjtj| tj| d+tjf|r|j<j?|q|r|j<j@||j<j=|qn5|rt.jAt }|r|j<j>d,|qnxt-jBrt jCqWt jDttdS(.Nis c:deihnr:st:s Error: %s %sRis-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-RSRORseditor-on-startupRRt classNametIdletIconstWindowssidle.icoRg!@g333333!@s.pngs.gifii i0s idle_%d%stwmt iconphotos-defaultt IDLESTARTUPt PYTHONSTARTUPsbif 1: import sys as _sys _sys.argv = %r del _sys s print('%s')(ii i0(ER)R~RvR}RtgetoptRtargvRRt usage_msgRtexitRR!R?R@RRRRRERRtabspathR`tdirnameRgtgetcwdR RWRR|RAt__file__Rt wm_iconbitmapt TkVersiont PhotoImagettktcallRzRRRR=RtsetupAppRvRltnewR>tisAquaTktdictRtlowerRaRtenvironR]RbRBRRDRZttkVersionWarningt inversedictRtdestroy(t enable_shellt enable_editRetcmdtscripttstartuptoptsRHR`totaRdtpathxRtdirt edit_startticondirticonfiletextRt iconfilesticonsRttkversionwarning((s%/usr/lib/python2.7/idlelib/PyShell.pyROs #                     $      ! /"%           R(Ot __future__RR?tos.pathRRRRRRRt tracebackRRRDRRJRRRRRt ImportErrorRR RRtidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorR tidlelib.UndoDelegatorR tidlelib.OutputWindowR tidlelib.configHandlerR R5R RRRRt ascii_letterstdigitsR^RRtsignalRR R&RRR$R%R)R~t checkcacheR1R2RRRt RPCClientRRRt TextIOBaseRRRRRORRR}(((s%/usr/lib/python2.7/idlelib/PyShell.pyts                        g