{fc@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZddlmZmZyddlTWn1ek reddejejdnXddlZdd lmZmZdd lmZdd lmZdd lm Z dd l!m"Z"ddl#m$Z$ddl%m&Z&ddl%m'Z'ddl%m(Z(ddl%m)Z)ddl%m*Z*ej+ej,dZ-dZ.dZ/yddl0m1Z1Wnek r dZ1nXeja2ddl3Z3e4dZ5e4e4dZ6e4a7dZ8e8e9e4e j:dZ;e;e _:defdYZ<defd YZ=d!efd"YZ>d#e fd$YZ?d%e&j@fd&YZAd'efd(YZBd)e"fd*YZCd+e jDfd,YZEd-eEfd.YZFd/eEfd0YZGd1ZHd2ZId3ZJeKd4krejLd4ejLd)>> N(Rtwarning_streamtwriteRtAttributeErrortIOError(RRRRRR((s'/usr/lib64/python2.7/idlelib/PyShell.pytidle_showwarningDs   cCsL|r*tdkrHtjatt_qHntdk rHtt_dandS(s>Replace warning.showwarning with idle_showwarning, or reverse.N(t_warnings_showwarningRtwarningst showwarningR$(tcapture((s'/usr/lib64/python2.7/idlelib/PyShell.pytcapture_warningsWs    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/lib64/python2.7/idlelib/PyShell.pytextended_linecache_checkcachefs  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/lib64/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/lib64/python2.7/idlelib/PyShell.pyR8s      tCuts<>trmenu_check_cuttCopys<>trmenu_check_copytPastes <>trmenu_check_pastesSet Breakpoints<>sClear Breakpoints<>cCse|jdkrdS|r:tj}tj|d}nidd6dd6}|jjd|dS(s,Turn colorizing of breakpoint text on or offNtbreaktt foregroundt backgroundtBREAK(RDRR t CurrentThemet GetHighlightR9t tag_config(R5tcolortthemetcfg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRGs cCs|j}|jj}|jdd|d|dy|jj|Wn!tk rk|jj|nXy&|jj j j }|j ||WnnXdS(NRSs%d.0i( R9RDRttag_addR7tindext ValueErrortappendR=tpyshelltinterptdebuggerR;(R5RR9Rtdebug((s'/usr/lib64/python2.7/idlelib/PyShell.pytset_breakpoints   cCsU|j}|jj}|s)|jdStt|jd}|j|dS(Ntinsert(R9RDRtbelltinttfloatR[Rb(R5teventR9RR((s'/usr/lib64/python2.7/idlelib/PyShell.pyR;s   cCs|j}|jj}|s)|jdStt|jd}y|jj|WnnX|j dddy&|j j j j }|j||WnnXdS(NRcRSsinsert linestartsinsert lineend +1char(R9RDRRdReRfR[R7tremovet tag_removeR=R^R_R`R<(R5RgR9RRRa((s'/usr/lib64/python2.7/idlelib/PyShell.pyR<s"    cCs|jr~|j}|jj}|s2|jdSg|_|jddty#|jjj j }|j |Wq~q~XndS(NRSs1.0( R7R9RDRRdRitENDR=R^R_R`tclear_file_breaks(R5R9RRa((s'/usr/lib64/python2.7/idlelib/PyShell.pyRks     c CsO|j}|jj}y+t|jd}|j}WdQXWntk rYg}nXyt|jdv}x1|D])}|j|dsy|j|qyqyW|j |j}|r|j|dt |dnWdQXWn`tk rJ}t |j dt sKt|j _tjddd d t |d |jqKnXdS( s#Save breakpoints when file is savedtrNtwt=s tbreakpoint_error_displayedttitles IDLE ErrorRs$Unable to update breakpoint list: %stparent(R7RDRtopenRCt readlinesR#t startswithR!tupdate_breakpointststrtgetattrtroottFalsetTrueRot tkMessageBoxt showerrorR9(R5tbreaksRtold_filetlinestnew_fileRterr((s'/usr/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(NRlRni(R9R-RDRRR?R@tisfileRCRrRsRttevaltlenRb(R5RRRtbreakpoint_linenumberstbreakpoint_linenumber((s'/usr/lib64/python2.7/idlelib/PyShell.pyR3 s     cCs4|j}|jd}|j|}||_dS(s3Retrieves all the breakpoints in the current windowRSN(R9t tag_rangestranges_to_linenumbersR7(R5R9trangestlinenumber_list((s'/usr/lib64/python2.7/idlelib/PyShell.pyRus cCsg}xtdt|dD]f}tt||j}tt||dj}x'||kr|j||d7}q^WqW|S(Niii(trangeRReRftstringR](R5RRR[Rtend((s'/usr/lib64/python2.7/idlelib/PyShell.pyR!s cCs|jtj|dS(s7Extend base method - clear breaks when module is closedN(RkRt_close(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyR2s (RIs<>RJ(RKs<>RL(RMs <>RNN(sSet Breakpoints<>N(sClear Breakpoints<>N(Rt __module__t__doc__R8Rt rmenu_specsRzRGRbR;R<RkRR3RuRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR2}s"      *   tPyShellFileListcBs&eZdZeZdZddZRS(s8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjn.t||_|jrJ|jjsJdSn|jS(N(R^ttoptwakeuptPyShelltbeginR(R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyR>As  N(RRRR2RRR^R>(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8stModifiedColorDelegatorcBs2eZdZdZdZdZdZRS(s8Extend base class: colorizer for the shell window itselfcCstj||jdS(N(R R8t LoadTagDefs(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8Os cCs7|jddd|jdddtj|dS(NtTODOs1.0tiomarktSYNC(RiRZR trecolorize_main(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRSscCs{tj|tj}|jjiidd6dd6d6tj|dd6tj|dd6tj|dd6dS(NRRRQtstdintstdouttstderrtconsole(R RR RTttagdefsR-RRU(R5RX((s'/usr/lib64/python2.7/idlelib/PyShell.pyRXs   cCs+x$|jD]}|j|ddq WdS(NRR(RRi(R5ttag((s'/usr/lib64/python2.7/idlelib/PyShell.pyt removecolorsbs(RRRR8RRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRLs    tModifiedUndoDelegatorcBs&eZdZddZddZRS(s;Extend base class: forbid insert/delete before the I/O markcCs[y-|jj|ddr,|jjdSWntk r@nXtj||||dS(Nt}tj|yt||_PWqtjk rYqXqW|j dS|jj j d|_t dkr|jj jtjtjdn|j|jj jdy|jjWntjk r|jdSX|jjd|j|jjd|jj|jjd|jj|jjd|jj|jjd |jj|jjd t|jjd ||jd t|j|jS( Niiii RRRRR=RR_twith_cwd( tHOSTRRttimetsleepRtrpcclttsocketterrortdisplay_port_binding_errorRtlistening_sockt getsocknameRt setsockoptt SOL_SOCKETt SO_REUSEADDRRt settimeouttacceptttimeouttdisplay_no_subprocess_errortregisterRRRRR=Rt transfer_pathRztpoll_subprocess(R5taddrti((s'/usr/lib64/python2.7/idlelib/PyShell.pytstart_subprocesss>      RPcCs|jr|jSt|_|j}|rLytj|jWqLqLXn|jj|j|j}|j }t |_ |j y|jj Wnt jk r|jdSX|jd||j|jjddd|r|nd}t|jt|ddd}|jd j|||jjd d|jjd d |su|jn|rtj|j|jn|j|j j!_"t |_|jS( NRRsend-1cs RESTART: tShelliiRns {0} {1} {0}trestarttleft(#RRRzt getdebuggerRtclose_subprocess_debuggertclosetunix_terminateRt executingRyRRRRRRRt stop_readlineR9RRetwidthRR!tformattmark_sett mark_gravityt showprompttrestart_subprocess_debuggertload_breakpointsRRRR(R5RRRaRt was_executingRthalfbar((s'/usr/lib64/python2.7/idlelib/PyShell.pytrestart_subprocesssH           %   cCs|jjdddidS(Ntexectinterrupt_the_server((Rt remotecall(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyt__request_interruptscCstjd|jjdS(Nttarget(t threadingtThreadt'_ModifiedInterpreter__request_interrupttstart(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytinterrupt_subprocess scCsp|jdk r(|jjj|jny|jjWntk rLnX|jt |j_ d|_dS(N( t_afteridRRR9t after_cancelRRR"RRyR(R5((s'/usr/lib64/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/lib64/python2.7/idlelib/PyShell.pyRs  cCsC|r"dg}|jtjn tj}|jd|fdS(NRPsRif 1: import sys as _sys _sys.path = %r del _sys (textendRR@t runcommand(R5RR@((s'/usr/lib64/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/lib64/python2.7/idlelib/PyShell.pyR6s@              cCs ||_dS(N(R`(R5R`((s'/usr/lib64/python2.7/idlelib/PyShell.pyt setdebugger^scCs|jS(N(R`(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRascCs|jjjd|jdS(sInitiate the remote stack viewer from a separate thread. This method is called from the subprocess, and by returning from this method we allow the subprocess to unblock. After a bit the shell requests the subprocess to open the remote stack viewer which returns a static object looking at the last exception. It is queried through the RPC mechanism. i,N(RR9R"R(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytopen_remote_stack_viewerds c Csddlm}|jjdddi}|dkrK|jjjdS|j|j|}ddl m }m }t |jj}t j}t j|dd}||d |d d } | jjd d dd|| jd|} | jdS(Ni(tRemoteObjectBrowserRt stackviewerR=(tScrolledCanvastTreeNodetnormalRRtbgthighlightthicknessitexpanditfilltboth(R=(tidlelibR+Rt remotequeueRRRxRdtStubObjectTreeItemtidlelib.TreeWidgetR-R.tToplevelR RTRUtframetpacktcanvasR2( R5R+toidtitemR-R.RRXRRtsctnode((s'/usr/lib64/python2.7/idlelib/PyShell.pyRqs  icCs#|j|}|j||dS(s1Like runsource() but assumes complete exec sourceN(t stuffsourcetexecfile(R5tsourceR((s'/usr/lib64/python2.7/idlelib/PyShell.pyt execsourcescCs|dkr$t|dj}nyt||ddt}WnWttfk r|jjt dd|jj t j |||jj nX|j|dS(sExecute an existing fileRlRt dont_inheritsB*** Error in script or command! Traceback (most recent call last):RN(RRrtreadRRzt OverflowErrort SyntaxErrorRRRRRtshowsyntaxerrorRtruncode(R5RRCtcode((s'/usr/lib64/python2.7/idlelib/PyShell.pyRBs    cCs|j|}d|_tj|_tjdddtt|trt j dkry#dt j |j t j f}Wqt k r|j j|jddSXnztj|||SWd|jdk r|jtj(d|_nXdS( sBExtend base class method: Stuff the source in the line cache firstitactionRRsutf-8s# -*- coding: %s -*- %ss Unsupported characters in input N(RAtmoreR&tfiltersRtfilterwarningst SyntaxWarningt isinstancetunicodeRtencodingtencodet UnicodeErrorRRR!Rt runsourceR(R5RCR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRVs$      cCsSd|j}|jd|_|jd}t|dd||ftj|<|S(s"Stuff source in the filename caches is i(tgidtsplitRRR*(R5RCRR((s'/usr/lib64/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/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( RR9t unpackerrorRZtseetgett IDENTCHARSRR!RvRRIR( R5RR9tstufftmsgRtoffsetRtpostchar((s'/usr/lib64/python2.7/idlelib/PyShell.pyRIs$      c Cstj\}}}|tk}|rey+|\}\}}}} |sQd}nWqed}qeXn|r{|||| fSdSdS(Ni(Rtexc_infoRHR( R5RtvaluettbtokR_tdummy_filenameRR`R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRZs   cCsJ|jj|jtj||jjdrF|jjndS(s1Extend base class method to reset output properlys<>N(RRtchecklinecacheRt showtracebackRtopen_stack_viewer(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRis    cCsFtj}x6|jD](}|d |ddkr||=qqWdS(Niis<>(RR*tkeys(R5tcR0((s'/usr/lib64/python2.7/idlelib/PyShell.pyRhs cBsQ|jjr|jdS|jrB|jjdd|fin ||jUdS(s*Run the code without invoking the debuggeriRRJi(RRtdisplay_executing_dialogRR6R(R5RK((s'/usr/lib64/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 methodRRJsExit?sDo you want to exit altogether?RtyesRqs IDLE internal error in runcode()RRN(RRR_RRhRRR&RNR`tbeginexecutingRt asyncqueueRtrunRt SystemExitRR{taskyesnoR9Rituse_subprocessRRR!tcanceledRyR"(R5RKR`((s'/usr/lib64/python2.7/idlelib/PyShell.pyRJ sR               cCs|jjj|dS(sOverride base class methodN(RRR!(R5R((s'/usr/lib64/python2.7/idlelib/PyShell.pyR!;scCs tjddd|jjdS(NsPort Binding ErrorsAIDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subprocess and refer to Help/IDLE Help 'Running without a subprocess' for further details.Rq(R{R|RR9(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyR?scCs tjddd|jjdS(NsSubprocess Startup ErrorsIDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection.Rq(R{R|RR9(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRJscCs tjddd|jjdS(NsAlready executingsYThe Python Shell window is already executing a command; please wait until it is finished.Rq(R{R|RR9(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRmRsN((RRR8RR RRRRRRyRRR R RRRRR`R)RR*RRWRDRBRVRARYRIRZRiRhRRJR!RRRm(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRsH    +-     &            1  RcBseZdedZeZeZd2d3d4d5d6d7gZddl m Z d8dZ dZ eZeZeZeZeZeZdZdZd8dZdZd8dZdZdZdZdZdZdZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d8d$Z'd%Z(d&Z)d'Z*d(Z+d)Z,d8d*Z-d8d+Z.d8d,Z/d-Z0d.Z1d9d/Z2d0Z3d1Z4RS(:sPython s ShellRt_Fileteditt_EditRat_Debugtoptionst_Optionstwindowst_Windowthelpt_Helpi(tHistorycCsatr9|j}|dddkr9|jddq9nt||_|dkrt}t||jt |}nt j ||ddt |_ d|_t |_|j}|jdd|jd|j|jd |j|jd |j|jd |j|jd |j|jd |j|jd|jtr~|jd|j|jd|jntj|_tj|_ tj!|_"ddl#m$}t%|d|j&|_!t'|d|j&|_t'|d|j&|_t'|d|j&|_(ts?|jt_|jt_|j!t_!n|j)|j|_*d|_+dS(NiitshelltShe_llitwrapRbs<>s<>s<>s<>s<>s<>s<>s<>s<>i(RRRRRi2(RR(,Rtt menu_specsRcRR_RtTkRtwithdrawRR R8Rztusetabst indentwidthtcontext_use_ps1R9t configureR:tenter_callbacktlinefeed_callbacktcancel_callbackt eof_callbackRjttoggle_debuggerttoggle_jit_stack_viewertview_restart_markt restart_shellRRt save_stdoutRt save_stderrRt save_stdinR5RtPseudoInputFileRStPseudoOutputFileRRthistoryR#(R5R=tmsRxR9R((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8psP              cCstjdtS(Nt shell_only(R t GetExtensionsRz(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytget_standard_extension_namesscCs |adS(N(R (R5tstream((s'/usr/lib64/python2.7/idlelib/PyShell.pytset_warning_streamscCstS(N(R (R5((s'/usr/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 idleRqRO( RR{R|R9tset_debugger_indicatorR_Rtclose_debuggert open_debugger(R5Rgtdb((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs     cCs%|jj}|jd| dS(Ns<>(R_Rtsetvar(R5R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCsdS(N((R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCs|jj}|r|jjd|j|jjrQtj|jjn|j|j j ddt _ |j n|jdS(Ns [DEBUG OFF] s>>> (R_RR)RRRRtclose_remote_debuggerRRR!Rtps1RR(R5R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs     cCsq|jjr'tj|jj|}ntj|}|jj||jdt_|j |j dS(Ns[DEBUG ON] >>> ( R_RRtstart_remote_debuggerRR)RRRRR(R5tdbg_gui((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs     cCs|jd|_dS(sHelper for ModifiedInterpreteriN(RR(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRos cCs d|_d|_|jdS(sHelper for ModifiedInterpreteriN(RRuR(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyR!s  cCsf|jr=tjddddd|j}|tkr=dSn|jt|_t|_t j |S(sExtend EditorWindow.close()sKill?s7Your program is still running! Do you want to kill it?RRfRqtcancel( RR{t askokcancelR9RyRRzRuRRR(R5R%((s'/usr/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(RRtR_R RRRRRRRRRR=R^RRR(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs        cCstS(s8Override EditorWindow method: never remove the colorizer(Rz(R5R((s'/usr/lib64/python2.7/idlelib/PyShell.pytispythonsource scCs|jS(N(t shell_title(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyt short_titlessHType "help", "copyright", "credits" or "license()" for more information.cCs|jtr<d}|jj}|sB|jtSnd}|jdtjtj |j |f|j j |j ddl}d|_tS(NRPs==== No Subprocess ====sPython %s on %s %s %si(RRtR_RRRyR!RtversionRt COPYRIGHTR9t focus_forceRtTkinterRt _default_rootRz(R5tnosubtclientR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs       cCs'|js dSt|_|jjdS(N(treadingRzt_stop_readline_flagRtquit(R5((s'/usr/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( NiRPRsend-1cis i(R(RRtmainloopRRyR9R\RRQRRR5RRTRSRURRuRtRt endoffile(R5R/RR((s'/usr/lib64/python2.7/idlelib/PyShell.pytreadline-s4              cCstS(N(Rz(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytisattyJscCsy |jjdddrdSWnnX|jp9|jsd|j|jjd|jdSd|_d|_ |jr|jj r|jj r|jj q|jj n|jr|jjndS(Ns sel.firsts!=ssel.lastsKeyboardInterrupt ROii(R9RRRRR_R!RRRuRRRR RR(R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRMs&     cCs|jr|j rdS|jjdddoD|jjdddsKdS|jsk|j|jnd|_d|_|jj dS(NRs==Rcsend-1ciiRO( RRR9RRRRuRRR(R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRcs      cCs@|jr/|jjdd|jjdn |j|dS(NRcs RO(RR9RcR[tnewline_and_indent_event(R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRrs   cCs|jr|j rdSyN|jjdd}|rd|jjdddrd|j||dSnWnnX|jjdddr|jjd d}|r|jjdd|d r|j|jj|d |d |dS|jjd d}|rK|jjd d |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<=RRORcRsiomark linestartRiisinsert lineends>=Rsinsert linestartsend-1csend-1c linestarts (RRR9R\Rtrecallt tag_prevranget tag_nextrangeRRRRRcR[RZtupdate_idletasksRRtrunit(R5RgtseltprevtnexttindicesR((s'/usr/lib64/python2.7/idlelib/PyShell.pyR{sX "'"'&      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*\nRPs\n\s*$s Rs1.0RRcsend-1csinsert linestartt:iis ^([ \t]*)(tretsubRXR9tundo_block_startRiRR\trstriptendswithRRcRRtsearchtgroupRtR[tundo_block_stop(R5RRgRtprefixtorig_base_indenttnew_base_indentR((s'/usr/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 (R9R\RR_RV(R5RR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs #  # cCso|jjr|jjSy tjWn!tjddd|jdSXddlm }||j |j dS(NsNo stack traces@There is no stack trace yet. (sys.last_traceback is not defined)Rqi(t StackBrowser( R_RRRtlast_tracebackR{R|R9tidlelib.StackViewerRRxR=(R5RgR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRjs     cCs$|jjd|jjddS(NRR(R9R[(R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCs|jjdtdS(s&Callback for Run/Restart Shell Cntl-F6RN(R_RRz(R5Rg((s'/usr/lib64/python2.7/idlelib/PyShell.pyRscCsk|jyttj}Wn d}nX|jj||jjdd|j|j j dS(NRPRcsend-1c( RRvRRRR!R9Rtset_line_and_columnRDt reset_undo(R5R((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs   cCs|jjdd}|jr1|jj|n|jjddkr_|jjddn|jjdd|jdtj_ dS(NRsend-1csend-2cs i( R9R\RtstoreRcRRRRt softspace(R5RC((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs  cCsry@|jjddtj|||d|jjddWnnX|jrnd|_tsntqnndS(NRtrightRi(R9RR R!RuRtR(R5RR((s'/usr/lib64/python2.7/idlelib/PyShell.pyR! s  cCsHy |jjdddrdSWntk r4dSXtt|jS(Ns sel.firstRRtdisabled(R9RRtsuperRRJ(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRJs  cCs/|jjdddrdStt|jS(NRcRRR(R9RRRRN(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRN!s(RRv(RwRx(RaRy(RzR{(R|R}(R~RN((5RRRRRR RR Rtidlelib.IdleHistoryRRR8RRyRRRuRRRRRRRRRRRoR!RRRRRRRRRRRRRRRRjRRRRR!RJRN(((s'/usr/lib64/python2.7/idlelib/PyShell.pyRZsd  2                   ?      t PseudoFilecBs;eZddZedZedZdZRS(cCs(||_||_d|_||_dS(Ni(RRRt _encoding(R5RRRS((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8(s   cCs|jS(N(R(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRS.scCs d|jS(Ns<%s>(R(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytname2scCstS(N(Rz(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyR6sN(RRRR8tpropertyRSRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR&s RcBseZdZdZRS(cCstS(N(Rz(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytwritable<scCs|jrtdnt|tttfkrt|tr]tj|td}qt|tr~tj |}qt|trtj |}qt dt|j n|j j||jS(Nswrite to closed filesmust be string, not (tclosedR\RRRRvt bytearrayRQt __getitem__tsliceRt__str__t TypeErrorRRR!R(R5R((s'/usr/lib64/python2.7/idlelib/PyShell.pyR!?s (RRRR!(((s'/usr/lib64/python2.7/idlelib/PyShell.pyR:s RcBs>eZddZdZddZddZdZRS(cCs#tj||||d|_dS(NRP(RR8t _line_buffer(R5RRRS((s'/usr/lib64/python2.7/idlelib/PyShell.pyR8QscCstS(N(Rz(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pytreadableUsicCs|jrtdn|dkr-d}n1t|ttfs^tdt|jn|j }d|_ |dkrxt r|j j }|sPn||7}qWnSx9t ||kr|j j }|sPn||7}qW|||_ || }|S(Nsread from closed fileismust be int, not RPi(RR\RRQRetlongRRRRRzRRR(R5tsizetresultR((s'/usr/lib64/python2.7/idlelib/PyShell.pyRFXs,         cCs|jrtdn|dkr-d}n1t|ttfs^tdt|jn|j ps|j j }|dkrt |}n|j dd|}|dkr|d}n|||_ || S(Nsread from closed fileismust be int, not is i(RR\RRQReRRRRRRRRtfind(R5RRteol((s'/usr/lib64/python2.7/idlelib/PyShell.pyRos       cCs|jjdS(N(RR(R5((s'/usr/lib64/python2.7/idlelib/PyShell.pyRsN(RRRR8RRFRR(((s'/usr/lib64/python2.7/idlelib/PyShell.pyROs     cCsJ|jdkrFx4dD])}|j|dd|j|dqWndS( s6Make paste replace selection on x11. See issue #5124.tx11tTexttEntrytSpinboxs <>s%catch {%W delete sel.first sel.last} N(RRR(t_windowingsystemt bind_class(Rxtcls((s'/usr/lib64/python2.7/idlelib/PyShell.pyt fix_x11_pastes s USAGE: idle [-deins] [-t title] [file]* idle [-dns] [-t title] (-c cmd | -r file) [arg]* idle [-dns] [-t title] - [arg]* -h print this help message and exit -n run IDLE without a subprocess (see Help/IDLE Help for details) The following options will override the IDLE 'settings' configuration: -e open an edit window -i open a shell window The following options imply -i and will open a shell: -c cmd run the command in a shell, or -r file run script from file -d enable the debugger -s run $IDLESTARTUP or $PYTHONSTARTUP before anything else -t title set title of shell window A default edit window will be bypassed when -c, -r, or - are used. [arg]* are passed to the command (-c) or script (-r) in sys.argv[1:]. Examples: idle Open an edit window or shell depending on IDLE's configuration. idle foo.py foobar.py Edit the files, also open a shell if configured to start with shell. idle -est "Baz" foo.py Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell window with the title "Baz". idle -c "import sys; print sys.argv" "foo" Open a shell window and run the command, passing "-c" in sys.argv[0] and "foo" in sys.argv[1]. idle -d -s -r foo.py "Hello World" Open a shell window, run a startup script, enable the debugger, and run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in sys.argv[1]. echo "import sys; print sys.argv" | idle - "foobar" Open a shell window, run the script piped in, passing '' in sys.argv[0] and "foobar" in sys.argv[1]. cCs#tttat}t}t}d}d}t}y#tjtjdd\}}Wn@tjk r}t d|t 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| n|rQtj?j@d0p tj?j@d1} | rQtjj| rQ|jAjB| qQn|s]|r|jAjCd2tjf|r|jAjD|q|r|jAjE||jAjB|qn5|rt2jFt }|r|jAjCd3|qnxt1jGr t jHqWt jIttdS(5Nis c:deihnr:st:s Error: %s %sRis-cs-ds-es-hs-is-ns-rsNo script file: s-ss-tit-RPRRseditor-on-startupRRt classNametIdlei(t fix_scalingtIconstWindowssidle.icoRg!@tdarwing333333!@s.pngs.gifii i0s idle_%d%stwmt iconphotos-defaultRss s<>t IDLESTARTUPt PYTHONSTARTUPsbif 1: import sys as _sys _sys.argv = %r del _sys s print('%s')(ii i0(JR)RzRtRyRtgetoptRtargvRRt usage_msgRtexitRR!R?R@RRRRRFRRtabspathR]tdirnameRctgetcwdR RRRxRt idlelib.runRRAt__file__Rt wm_iconbitmapt TkVersionRt PhotoImagettktcallRvRRRR=RtsetupApptisAquaTkt unbind_classRrRhtnewR>tdictRtlowerR^RtenvironR\R_RBRRDRYttkVersionWarningt inversedictRtdestroy(t enable_shellt enable_editRatcmdtscripttstartuptoptsRHR_totaRtpathxRtdirt edit_startRticondirticonfiletextRt iconfilesticonsRttkversionwarning((s'/usr/lib64/python2.7/idlelib/PyShell.pyRs #                     $        !/"%            R(Nt __future__RR?tos.pathRRRRRRRRDRRKRRRRRt ImportErrorRR RR{tidlelib.EditorWindowRRtidlelib.FileListRtidlelib.ColorDelegatorR tidlelib.UndoDelegatorR tidlelib.OutputWindowR tidlelib.configHandlerR R5R RRRRt ascii_letterstdigitsR]RRtsignalRR R&RRR$R%R)Rzt checkcacheR1R2RRRt RPCClientRRRt TextIOBaseRRRRRRRRRy(((s'/usr/lib64/python2.7/idlelib/PyShell.pyts                      4 >