ž pyMaâc @s~ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZyddlTWn2ek reddejƒejdƒYnXddljZddlmZmZdd lmZdd l m!Z!dd l"m#Z#dd l$m%Z%dd l&m'Z'ddl(m)Z)ddl(m*Z*ddl(m+Z+ddl(m,Z,ddl(m-Z-dZ.dZ/eja0ddl1Z1e2dd„Z3e2e2dd„Z4e2a5dd„Z6e6e7ƒe2e j8dd„Z9e9e _8Gdd„deƒZ:Gdd„deƒZ;Gd d!„d!e!ƒZ<Gd"d#„d#e#ƒZ=Gd$d%„d%e*j>ƒZ?Gd&d'„d'eƒZ@Gd(d)„d)e%ƒZAGd*d+„d+e jBƒZCGd,d-„d-eCƒZDGd.d/„d/eCƒZEd0ZFd1d2„ZGeHd3krpejId3ejId)>> N(uNoneuwarning_streamuwriteuidle_formatwarninguAttributeErroruOSError(umessageucategoryufilenameulinenoufileuline((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuidle_showwarning@s   uidle_showwarningcCsL|r*tdkrHtjatt_qHntdk rHtt_dandS(u>Replace warning.showwarning with idle_showwarning, or reverse.N(u_warnings_showwarninguNoneuwarningsu showwarninguidle_showwarning(ucapture((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyucapture_warningsSs    ucapture_warningscCs{tj}i}xNt|ƒD]@}|dd…|dd…dkr|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. Niu<>iÿÿÿÿ(u linecacheucacheulistupopuupdate(ufilenameuorig_checkcacheucacheusaveukey((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuextended_linecache_checkcachebs $ uextended_linecache_checkcachecBs°|EeZdZdZdd„Zd$d%d&d'd(d)gZdd„Zd#dd„Zd#dd„Z dd„Z dd„Z dd„Z dd„Z dd „Zd!d"„Zd#S(*uPyShellEditorWindowu6Regular text edit window in IDLE, supports breakpointscGsÁg|_tj||Œ|jjd|jƒ|jjd|jƒ|jjd|jjƒt j j t j ƒdƒ|_|jj|dd„}|jj|ƒ|jjr½|jƒndS(Nu<>u<>u<>ubreakpoints.lstcSs|jƒ|ƒdS(N(urestore_file_breaks(uold_hookuself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyufilename_changed_hook†s u;PyShellEditorWindow.__init__..filename_changed_hook(u breakpointsu EditorWindowu__init__utextubinduset_breakpoint_hereuclear_breakpoint_hereuflistu open_shelluosupathujoinuidleConfu GetUserCfgDirubreakpointPathuioufilename_change_hookuset_filename_change_hookufilenameurestore_file_breaks(uselfuargsufilename_changed_hook((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu__init__|s    uPyShellEditorWindow.__init__uCutu<>urmenu_check_cutuCopyu<>urmenu_check_copyuPasteu <>urmenu_check_pasteuSet Breakpointu<>uClear Breakpointu<>cCs¤|j}|jj}|jdd|d|dƒy|jj|ƒ}Wn"tk rn|jj|ƒYnXy&|jj j j }|j ||ƒWnYnXdS(NuBREAKu%d.0i( utextuioufilenameutag_addu breakpointsuindexu ValueErroruappenduflistupyshelluinterpudebuggeruset_breakpoint_here(uselfulinenoutextufilenameuiudebug((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuset_breakpoint—s   u"PyShellEditorWindow.set_breakpointcCsU|j}|jj}|s)|jƒdStt|jdƒƒƒ}|j|ƒdS(Nuinsert(utextuioufilenameubelluintufloatuindexuset_breakpoint(uselfueventutextufilenameulineno((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuset_breakpoint_here¥s   u'PyShellEditorWindow.set_breakpoint_herecCs«|j}|jj}|s)|jƒdStt|jdƒƒƒ}y|jj|ƒWnYnX|j dddƒy&|j j j j }|j||ƒWnYnXdS(NuinsertuBREAKuinsert linestartuinsert lineend +1char(utextuioufilenameubelluintufloatuindexu breakpointsuremoveu tag_removeuflistupyshelluinterpudebuggeruclear_breakpoint_here(uselfueventutextufilenameulinenoudebug((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuclear_breakpoint_here®s"    u)PyShellEditorWindow.clear_breakpoint_herec Csƒ|jr|j}|jj}|s2|jƒdSg|_|jddtƒy#|jjj j }|j |ƒWqYqXndS(NuBREAKu1.0( u breakpointsutextuioufilenameubellu tag_removeuENDuflistupyshelluinterpudebuggeruclear_file_breaks(uselfutextufilenameudebug((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuclear_file_breaksÁs     u%PyShellEditorWindow.clear_file_breakscCsb|j}|jj}y+t|jdƒ}|jƒ}WdQXWntk rZg}YnXyŽt|jdƒv}x1|D])}|j|dƒsz|j|ƒqzqzW|j ƒ|j}|râ|j|dt |ƒdƒnWdQXWnrtk r]}zRt |j dd ƒsKd |j _tjddd d t |ƒd |jƒnWYdd}~XnXdS(u#Save breakpoints when file is savedurNuwu=u ubreakpoint_error_displayedutitleu IDLE Errorumessageu$Unable to update breakpoint list: %suparentFT(u breakpointsuioufilenameuopenubreakpointPathu readlinesuOSErroru startswithuwriteuupdate_breakpointsustrugetattrurootuFalseuTrueubreakpoint_error_displayedu tkMessageBoxu showerrorutext(uselfubreaksufilenameufpulinesunew_fileulineuerr((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyustore_file_breaksÐs.       ,  u%PyShellEditorWindow.store_file_breaksc Csä|jjƒ|jdkr dS|jj}|dkr<dStjj|jƒràt |jdƒ}|j ƒ}WdQXxe|D]Z}|j |dƒrt |t |ƒdd…ƒ}x|D]}|j|ƒq¿WqqWndS(Nuru=i(utextuupdateuiouNoneufilenameuosupathuisfileubreakpointPathuopenu readlinesu startswithuevalulenuset_breakpoint(uselfufilenameufpulinesulineubreakpoint_linenumbersubreakpoint_linenumber((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyurestore_file_breaksÿs      u'PyShellEditorWindow.restore_file_breakscCs4|j}|jdƒ}|j|ƒ}||_dS(u3Retrieves all the breakpoints in the current windowuBREAKN(utextu tag_rangesuranges_to_linenumbersu breakpoints(uselfutexturangesulinenumber_list((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuupdate_breakpointss u&PyShellEditorWindow.update_breakpointscCsg}x€tdt|ƒdƒD]f}tt||jƒƒ}tt||djƒƒ}x'||kr„|j|ƒ|d7}q^WqW|S(Niii(urangeulenuintufloatustringuappend(uselfurangesulinesuindexulinenouend((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuranges_to_linenumberss u)PyShellEditorWindow.ranges_to_linenumberscCs|jƒtj|ƒdS(u7Extend base method - clear breaks when module is closedN(uclear_file_breaksu EditorWindowu_close(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu_close(s uPyShellEditorWindow._closeN(uCutu<>urmenu_check_cut(uCopyu<>urmenu_check_copy(uPasteu <>urmenu_check_paste(NNN(uSet Breakpointu<>N(uClear Breakpointu<>N(u__name__u __module__u __qualname__u__doc__u__init__uNoneu rmenu_specsuset_breakpointuset_breakpoint_hereuclear_breakpoint_hereuclear_file_breaksustore_file_breaksurestore_file_breaksuupdate_breakpointsuranges_to_linenumbersu_close(u __locals__((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuPyShellEditorWindowys"      /   uPyShellEditorWindowcBs5|EeZdZdZeZdZddd„ZdS(uPyShellFileListu8Extend base class: IDLE supports a shell and breakpointscCsQ|jr|jjjƒn.t|ƒ|_|jrJ|jjƒsJdSn|jS(N(upyshellutopuwakeupuPyShellubeginuNone(uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu open_shell7s  uPyShellFileList.open_shellN( u__name__u __module__u __qualname__u__doc__uPyShellEditorWindowu EditorWindowuNoneupyshellu open_shell(u __locals__((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuPyShellFileList.suPyShellFileListcBsJ|EeZdZdZdd„Zdd„Zdd„Zdd „Zd S( uModifiedColorDelegatoru8Extend base class: colorizer for the shell window itselfcCstj|ƒ|jƒdS(N(uColorDelegatoru__init__u LoadTagDefs(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu__init__Es uModifiedColorDelegator.__init__cCs7|jdddƒ|jdddƒtj|ƒdS(NuTODOu1.0uiomarkuSYNC(u tag_removeutag_adduColorDelegatorurecolorize_main(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyurecolorize_mainIsu&ModifiedColorDelegator.recolorize_maincCs„tj|ƒtjdddƒ}|jjiidd6dd6d6tj|dƒd6tj|dƒd6tj|d ƒd 6ƒdS( NumainuThemeunameu backgroundu foregroundustdinustdoutustderruconsole(uColorDelegatoru LoadTagDefsuidleConfu GetOptionutagdefsuupdateuNoneu GetHighlight(uselfutheme((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu LoadTagDefsNs  u"ModifiedColorDelegator.LoadTagDefscCs+x$|jD]}|j|ddƒq WdS(Nuiomarkuend(utagdefsu tag_remove(uselfutag((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu removecolorsXsu#ModifiedColorDelegator.removecolorsN(u__name__u __module__u __qualname__u__doc__u__init__urecolorize_mainu LoadTagDefsu removecolors(u __locals__((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuModifiedColorDelegatorBs    uModifiedColorDelegatorcBs8|EeZdZdZddd„Zddd„ZdS(uModifiedUndoDelegatoru;Extend base class: forbid insert/delete before the I/O markc Cs\y-|jj|ddƒr,|jjƒdSWntk rAYnXtj||||ƒdS(NuuModifiedInterpretercCsf||_tjdj}tj|d|ƒd|_d|_ d|_ t |_ |j jj|_dS(Nu__main__ulocalsF(u tkconsoleusysumodulesu__dict__uInteractiveInterpreteru__init__uNoneusave_warnings_filtersuFalseu restartingusubprocess_arglistuPORTuportucompileucompileruflagsuoriginal_compiler_flags(uselfu tkconsoleulocals((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu__init__|s     uModifiedInterpreter.__init__cCs:|jdkr!|jƒ|_ntj|jƒ|_dS(N(usubprocess_arglistuNoneubuild_subprocess_arglistu subprocessuPopenu rpcsubproc(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuspawn_subprocessŠsu$ModifiedInterpreter.spawn_subprocesscCs„dd„tjDƒ}tjddddd ddƒ}td krSd |f}n d |f}tjg|d |t|jƒgS(NcSsg|]}d|‘qS(u-W((u.0us((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu ’s u@ModifiedInterpreter.build_subprocess_arglist..umainuGeneraludelete-exitfuncudefaultutypeubooluidlelib.PyShellu&__import__('idlelib.run').run.main(%r)u__import__('run').main(%r)u-cF( usysu warnoptionsuidleConfu GetOptionuFalseu__name__u executableustruport(uselfuwu del_exitfucommand((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyubuild_subprocess_arglists  u,ModifiedInterpreter.build_subprocess_arglistcCsït|jf}xntdƒD]R}tj|ƒyt|ƒ|_PWqtjk rm}zWYdd}~XqXqW|j ƒdS|jj j ƒd|_t dkrÇ|jj jtjtjdƒn|jƒ|jj jdƒy|jjƒWn6tjk r-}z|jƒdSWYdd}~XnX|jjd|jƒ|jjd|jjƒ|jjd|jjƒ|jjd|jjƒ|jjd |jjƒ|jjd tƒ|jjd |ƒ|jd d ƒ|jƒ|jS(Niiii uconsoleustdinustdoutustderruflistu linecacheuinterpuwith_cwdT( uHOSTuporturangeutimeusleepu MyRPCClienturpccltusocketuerrorudisplay_port_binding_erroruNoneulistening_socku getsocknameuPORTu setsockoptu SOL_SOCKETu SO_REUSEADDRuspawn_subprocessu settimeoutuacceptutimeoutudisplay_no_subprocess_erroruregisteru tkconsoleustdinustdoutustderruflistu linecacheu transfer_pathuTrueupoll_subprocess(uselfuaddruiuerr((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyustart_subprocessžs>      u$ModifiedInterpreter.start_subprocesscCsÇ|jr|jSd |_|jƒ}|rMytj|jƒWqMYqMXn|jjƒ|jƒ|j}|j }d |_ |j ƒy|jj ƒWn6t jk rÒ}z|jƒdSWYdd}~XnX|jd|ƒ|jƒ|jjddƒ|r |jdƒ|jƒnt|jƒddd}|j|d|ƒ|jjd dƒ|jjd d ƒ|jƒ|r¥tj|jƒ}|jƒn|j|jj_ d |_|jS( Nuwith_cwduiomarkuend-1cu iiu=u RESTART urestartuleftTF(!u restartingurpccltuTrueu getdebuggeruRemoteDebuggeruclose_subprocess_debuggerucloseuterminate_subprocessu tkconsoleu executinguFalseuspawn_subprocessuacceptusocketutimeoutudisplay_no_subprocess_erroruNoneu transfer_pathu stop_readlineutextudeleteuwriteu showpromptuintuwidthumark_setu mark_gravityurestart_subprocess_debuggeruload_breakpointsuoriginal_compiler_flagsucompileucompileruflags(uselfuwith_cwdudebuguconsoleu was_executinguerruhalfbarugui((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyurestart_subprocessÉsJ                u&ModifiedInterpreter.restart_subprocesscCs|jjddfiƒdS(Nuexecuinterrupt_the_server(urpccltu remotecall(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu__request_interrupt÷su'ModifiedInterpreter.__request_interruptcCstjd|jƒjƒdS(Nutarget(u threadinguThreadu'_ModifiedInterpreter__request_interruptustart(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuinterrupt_subprocessúsu(ModifiedInterpreter.interrupt_subprocesscCsš|jdk r(|jjj|jƒny|jjjƒWntk rPYnXy|jjƒWntk rvYnX|j ƒd|j_ d|_dS(NF( u_afteriduNoneu tkconsoleutextu after_cancelurpccltulistening_sockucloseuAttributeErroruterminate_subprocessuFalseu executing(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyukill_subprocessýs    u#ModifiedInterpreter.kill_subprocesscCsXy|jjƒWntk r)dSYn+Xy|jjƒWntk rSdSYnXdS(u"Make sure subprocess is terminatedN(u rpcsubprocukilluOSErroruwait(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuterminate_subprocess s   u(ModifiedInterpreter.terminate_subprocesscCsC|r"dg}|jtjƒn tj}|jd|fƒdS(NuuRif 1: import sys as _sys _sys.path = %r del _sys (uextendusysupathu runcommand(uselfuwith_cwdupath((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu transfer_paths   u!ModifiedInterpreter.transfer_pathcCs§|j}|dkrdSy|j|jddƒ}Wn;tttfk rr|jjr^dSd}|j ƒYnX|rp|jj ƒd|_|\}}|jj }|dkrÛ|dk rGt t |ƒd|ƒqGnl|dkr |jjdƒrG|jƒqGn>|dkrGd}t ||dtjƒt ||d|ƒny|jjƒWqptk rlYqpXn|jjs£|jjj|jj|jƒ|_ndS( Nuwaitgš™™™™™©?uOKufileu EXCEPTIONu<>uERRORu/PyShell.ModifiedInterpreter: Subprocess ERROR: (urpccltuNoneu pollresponseu active_sequEOFErroruOSErroruKeyboardInterruptu tkconsoleuclosingurestart_subprocessu resetoutputuconsoleuprintureprugetvaruremote_stack_viewerusysu __stderr__u endexecutinguAttributeErrorutextuafteru pollintervalupoll_subprocessu_afterid(uselfuclturesponseuhowuwhatuconsoleuerrmsg((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyupoll_subprocess(s@              u#ModifiedInterpreter.poll_subprocesscCs ||_dS(N(udebugger(uselfudebugger((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu setdebuggerPsuModifiedInterpreter.setdebuggercCs|jS(N(udebugger(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu getdebuggerSsuModifiedInterpreter.getdebuggercCs|jjjd|jƒdS(u’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(u tkconsoleutextuafteruremote_stack_viewer(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuopen_remote_stack_viewerVs u,ModifiedInterpreter.open_remote_stack_viewerc Csddlm}|jjdddiƒ}|dkrK|jjjƒdS|j|j|ƒ}ddl m }m }t |jjƒ}t jddd ƒ}t j|d ƒd }||d |d dƒ} | jjddddƒ|| jd|ƒ} | jƒdS(Ni(uRemoteObjectBrowseruexecu stackvieweruflist(uScrolledCanvasuTreeNodeumainuThemeunameunormalu backgroundubguhighlightthicknessuexpandiufilluboth(uflist(uidlelibuRemoteObjectBrowserurpccltu remotequeueuNoneu tkconsoleurootubelluStubObjectTreeItemuidlelib.TreeWidgetuScrolledCanvasuTreeNodeuTopleveluidleConfu GetOptionu GetHighlightuframeupackucanvasuexpand( uselfuRemoteObjectBrowseruoiduitemuScrolledCanvasuTreeNodeutoputhemeu backgrounduscunode((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuremote_stack_viewercs u'ModifiedInterpreter.remote_stack_viewericCs#|j|ƒ}|j||ƒdS(u1Like runsource() but assumes complete exec sourceN(u stuffsourceuexecfile(uselfusourceufilename((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu execsourcevsuModifiedInterpreter.execsourcecCsË|dkr3tj|ƒ}|jƒ}WdQXnyt||dƒ}Wnnttfk r¹|jjƒ|jj }t dd|ƒt dd|ƒt j ||ƒ|jj ƒYnX|j|ƒdS(uExecute an existing fileNuexecu *** Error in script or command! ufileu"Traceback (most recent call last):(uNoneutokenizeuopenureaducompileu OverflowErroru SyntaxErroru tkconsoleu resetoutputustderruprintuInteractiveInterpreterushowsyntaxerroru showprompturuncode(uselfufilenameusourceufpucodeutkerr((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuexecfile{s   uModifiedInterpreter.execfilec Cs”|j|ƒ}d|_tjdd…|_tjdddtƒztj|||ƒSWd|jdk r|jtjdd…iu i(ugidusplitulenu linecacheucache(uselfusourceufilenameulines((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu stuffsource¥s  #uModifiedInterpreter.stuffsourcecCs|jd|fƒdS(u>Prepend sys.path with file's directory if not already includedu(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(u runcommand(uselfufilename((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuprepend_syspath­su#ModifiedInterpreter.prepend_syspathc Cs|j}|j}|jdddƒtjƒ\}}}t|ddƒpU|pUd}t|ddƒpmd}t|d dƒp…d } | d kr¡|d7}n|dkr¾d | d} nd |d| df} |j|| ƒ|jƒ|jd |ƒ|j ƒdS(u§Override Interactive Interpreter method: Use Colorizing Color the offending position instead of printing it and pointing at it with a caret. uERRORu1.0uendumsguuulinenoiuoffsetiuiomark + %d charsu&iomark linestart + %d lines + %d charsuSyntaxError: %s N( u tkconsoleutextu tag_removeusysuexc_infougetattrucolorize_syntax_erroru resetoutputuwriteu showprompt( uselfufilenameu tkconsoleutextutypeuvalueutbumsgulinenouoffsetupos((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyushowsyntaxerror¹s"      u#ModifiedInterpreter.showsyntaxerrorcCsJ|jjƒ|jƒtj|ƒ|jjdƒrF|jjƒndS(u1Extend base class method to reset output properlyu<>N(u tkconsoleu resetoutputuchecklinecacheuInteractiveInterpreteru showtracebackugetvaruopen_stack_viewer(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu showtracebackÓs    u!ModifiedInterpreter.showtracebackcCsXtj}xHt|jƒƒD]4}|dd…|dd…dkr||=qqWdS(Niu<>iÿÿÿÿ(u linecacheucacheulistukeys(uselfucukey((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuchecklinecacheÛs $u"ModifiedInterpreter.checklinecachecCsV|jjr|jƒdS|jrB|jjdd|fiƒnt||jƒdS(u*Run the code without invoking the debuggeriuexecuruncodei(u tkconsoleu executingudisplay_executing_dialogurpccltu remotequeueuexeculocals(uselfucode((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu runcommandás   uModifiedInterpreter.runcommandcCså|jjr|jjƒn|jƒ|jdk rW|jtjdd…d?„Z,d@dA„Z-dBdC„Z.dDdE„Z/d^dFdG„Z0d^dHdI„Z1d^dJdK„Z2dLdM„Z3dNdO„Z4fdPdQ„Z5‡fdRdS†Z6‡fdTdU†Z7‡S(`uPyShelluPython u Shellufileu_Fileueditu_Editudebugu_Debuguoptionsu_Optionsuwindowsu_Windowsuhelpu_Helpu_Windowii(uHistoryc Cs—tr9|j}|dddkr9|jddƒq9nt|ƒ|_|dkr€tƒ}t|ƒ|jƒt |ƒ}nt j ||ddƒd|_ d|_d|_|j}|jddƒ|jd|jƒ|jd |jƒ|jd |jƒ|jd |jƒ|jd |jƒ|jd |jƒ|jd|jƒtr~|jd|jƒ|jd|jƒntj|_tj|_ tj!|_"ddl#m$}t%|d|j&ƒ|_!t'|d|j&ƒ|_t'|d|j&ƒ|_t'|d|j&ƒ|_(ts?|jt_|jt_|j!t_!nyddl)}|j*|_+Wntj,t_‚YnX|j-|jƒ|_.d|_/dS(NiiushelluShe_lliuwrapucharu<>u<>u<>u<>u<>u<>u<>u<>u<>(u IOBindingustdinustdoutustderruconsolei2(ushelluShe_llT(0uuse_subprocessu menu_specsuinsertuModifiedInterpreteruinterpuNoneuTku fixwordbreaksuwithdrawuPyShellFileListu OutputWindowu__init__uTrueuusetabsu indentwidthucontext_use_ps1utextu configureubinduenter_callbackulinefeed_callbackucancel_callbacku eof_callbackuopen_stack_viewerutoggle_debuggerutoggle_jit_stack_vieweruview_restart_marku restart_shellusysustdoutu save_stdoutustderru save_stderrustdinu save_stdinuidlelibu IOBindinguPseudoInputFileuencodinguPseudoOutputFileuconsoleupydocu plainpagerupageru __stderr__uHistoryuhistoryu pollinterval(uselfuflistumsurootutextu IOBindingupydoc((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu__init__Vs\                uPyShell.__init__cCstjddƒS(Nu shell_onlyT(uidleConfu GetExtensionsuTrue(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuget_standard_extension_namessu$PyShell.get_standard_extension_namescCs |adS(N(uwarning_stream(uselfustream((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuset_warning_streamšsuPyShell.set_warning_streamcCstS(N(uwarning_stream(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuget_warning_streamžsuPyShell.get_warning_streamcCs`|jr0tjddd|jƒ|jƒdS|jjƒ}|rR|jƒn |jƒdS(NuDon't debug nowu*You can only toggle the debugger when idleumasterubreak( u executingu tkMessageBoxu showerrorutextuset_debugger_indicatoruinterpu getdebuggeruclose_debuggeru open_debugger(uselfueventudb((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyutoggle_debugger¡s     uPyShell.toggle_debuggercCs%|jjƒ}|jd| ƒdS(Nu<>(uinterpu getdebuggerusetvar(uselfudb((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuset_debugger_indicator¯suPyShell.set_debugger_indicatorcCsdS(N((uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyutoggle_jit_stack_viewer³suPyShell.toggle_jit_stack_viewercCs|jjƒ}|r|jjdƒ|jƒ|jjrQtj|jjƒn|jƒ|j j dƒdt _ |j ƒn|jƒdS(Nu [DEBUG OFF] u>>> (uinterpu getdebuggeru setdebuggeruNoneucloseurpccltuRemoteDebuggeruclose_remote_debuggeru resetoutputuconsoleuwriteusysups1u showpromptuset_debugger_indicator(uselfudb((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuclose_debugger¶s     uPyShell.close_debuggercCsq|jjr'tj|jj|ƒ}ntj|ƒ}|jj|ƒ|jƒdt_|j ƒ|j ƒdS(Nu[DEBUG ON] >>> ( uinterpurpccltuRemoteDebuggerustart_remote_debuggeruDebuggeru setdebuggeruload_breakpointsusysups1u showpromptuset_debugger_indicator(uselfudbg_gui((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu open_debuggerÃs     uPyShell.open_debuggercCs|jƒd|_dS(uHelper for ModifiedInterpreteriN(u resetoutputu executing(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyubeginexecutingÏs uPyShell.beginexecutingcCs d|_d|_|jƒdS(uHelper for ModifiedInterpreteriN(u executingucanceledu showprompt(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu endexecutingÔs  uPyShell.endexecutingcCsf|jr=tjddddd|jƒ}|dkr=dSn|jƒd|_d|_t j |ƒS( uExtend EditorWindow.close()uKill?u6The program is still running! Do you want to kill it?udefaultuokuparentucancelFT( u executingu tkMessageBoxu askokcancelutextuFalseu stop_readlineuTrueucanceleduclosingu EditorWindowuclose(uselfuresponse((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyucloseÚs      u PyShell.closecCs||jƒtr |jjƒn|jt_|jt_|j t_ d|_d|_ d|j _d|_tj|ƒdS(uEExtend EditorWindow._close(), shut down debugger and execution serverN(uclose_debuggeruuse_subprocessuinterpukill_subprocessu save_stdoutusysustdoutu save_stderrustderru save_stdinustdinuNoneuconsoleuflistupyshelluhistoryu EditorWindowu_close(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu_closeés        uPyShell._closecCsdS(u8Override EditorWindow method: never remove the colorizerT(uTrue(uselfufilename((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuispythonsourceùsuPyShell.ispythonsourcecCs|jS(N(u shell_title(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu short_titleýsuPyShell.short_titleu@Type "copyright", "credits" or "license()" for more information.cCsª|jjddƒ|jƒtrOd}|jjƒ}|sa|jƒdSnd}tj t _ |j dt j t j |j|fƒ|jƒddl}d|_dS( Nuiomarkuinsertuu==== No Subprocess ====uPython %s on %s %s %siFT(utextumark_setu resetoutputuuse_subprocessuinterpustart_subprocessucloseuFalseurpcu displayhookusysuwriteuversionuplatformu COPYRIGHTu showpromptutkinteruNoneu _default_rootuTrue(uselfunosubuclientutkinter((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyubegins        u PyShell.begincCs'|js dSd|_|jjƒdS(NT(ureadinguTrueu_stop_readline_flagutopuquit(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu stop_readlines  uPyShell.stop_readlinec CsÃ|j}zd|_|jjƒWd||_X|jrFd|_dS|jjddƒ}t|ƒdkrvd}n|jƒ|j r¤d|_ t s¤t ‚q¤n|j r¿d|_ d}n|S(Niuuiomarkuend-1ciu F( ureadingutopumainloopu_stop_readline_flaguFalseutextugetulenu resetoutputucanceleduuse_subprocessuKeyboardInterruptu endoffile(uselfusaveuline((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyureadlines(             uPyShell.readlinecCsdS(NT(uTrue(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuisatty4suPyShell.isattyc CsØy |jjdddƒrdSWnYnX|jp:|jse|jƒ|jjdƒ|jƒdSd|_d|_ |jr»|jj r»|jj ƒr«|jj ƒq»|jj ƒn|jrÔ|jjƒndS(Nu sel.firstu!=usel.lastuKeyboardInterrupt ubreakii(utextucompareu executingureadingu resetoutputuinterpuwriteu showpromptu endoffileucanceledurpccltu getdebuggerurestart_subprocessuinterrupt_subprocessutopuquit(uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyucancel_callback7s&     uPyShell.cancel_callbackcCsŽ|jr|j rdS|jjdddƒoD|jjdddƒsKdS|jsk|jƒ|jƒnd|_d|_|jj ƒdS(Nuiomarku==uinsertuend-1ciiubreak( u executingureadingutextucompareu resetoutputucloseucanceledu endoffileutopuquit(uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu eof_callbackMs      uPyShell.eof_callbackcCs@|jr/|jjddƒ|jjdƒn |j|ƒdS(Nuinsertu ubreak(ureadingutextuinsertuseeunewline_and_indent_event(uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyulinefeed_callback\s   uPyShell.linefeed_callbackcCsú|jr|j rdSyN|jjddƒ}|rd|jjdddƒrd|j||ƒdSnWnYnX|jjdddƒrÌ|jjd dƒ}|rê|jjdd|d ƒrê|j|jj|d |d ƒ|ƒdS|jjd dƒ}|rL|jjd d |d ƒrL|j|jj|d |d ƒ|ƒdS|jjddƒ}|r©|jj|d ddƒr©|j|jj|d d ƒ|ƒn|j|jjdd ƒ|ƒdS|jjdddƒrú|jjddƒn|jjddƒ}|r8|j ƒ r8|jj ddƒn|jjdddƒra|j |ƒdS|jjddƒ|jr£|jj ddƒ|jj dƒn |j |ƒ|jjd ddƒ|jjƒ|jrì|jjƒn |jƒdS(Nu sel.firstusel.lastu<=uiomarkubreakuinsertu=uconsoleuinsert linestartuend-1cuend-1c linestartu (u executingureadingutextugetucompareurecallu tag_prevrangeu tag_nextrangeumark_setustripudeleteunewline_and_indent_eventuinsertuseeutag_adduupdate_idletasksutopuquiturunit(uselfueventuseluprevunextuindicesus((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuenter_callbackesX "'"'&      uPyShell.enter_callbackc Cs·tjdd|ƒ}tjdd|ƒ}|jdƒ}|jjƒzL|jjdddƒ|jjdd ƒ|jjd dƒ}|jƒj d ƒrÁ|j |ƒ|jjd dƒ}n|jj d|d j ƒƒt |ƒd kr‘tjd|d ƒjd ƒ}tjd|ƒjd ƒ}xd|d d…D]O}|j|ƒrm||t |ƒd…}n|jj dd|jƒƒq;WnWd|jjdƒ|jjƒXdS(Nu^\s*\nuu\n\s*$u uselu1.0uenduinsertuend-1cuinsert linestartu:iiu ^([ \t]*)(ureusubusplitutextuundo_block_startu tag_removeumark_setugeturstripuendswithunewline_and_indent_eventuinsertustripulenusearchugroupu startswithuseeuundo_block_stop(uselfusueventulinesuprefixuorig_base_indentunew_base_indentuline((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyurecall¤s*  (uPyShell.recallcCsÖ|jjddƒ}t|ƒ}x.|dkrQ||ddkrQ|d}q$W|dkr||ddkr|d}nx.|dkr¯||ddkr¯|d}q‚W|d|…}|jj|ƒ}dS(Nuiomarkuend-1ciiu u (utextugetulenuinterpu runsource(uselfulineuiumore((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyurunit¾s #  #u PyShell.runitc Csu|jjr|jjƒSy tjWn%tjddd|jƒdSYnXddlm }||j |j ƒ}dS(NuNo stack traceu@There is no stack trace yet. (sys.last_traceback is not defined)umasteri(u StackBrowser( uinterpurpcclturemote_stack_viewerusysulast_tracebacku tkMessageBoxu showerrorutextuidlelib.StackVieweru StackBrowserurootuflist(uselfueventu StackBrowserusv((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuopen_stack_viewerÌs      uPyShell.open_stack_viewercCs$|jjdƒ|jjdƒdS(Nuiomarkurestart(utextusee(uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuview_restart_markÚsuPyShell.view_restart_markcCs|jjddƒdS(u&Callback for Run/Restart Shell Cntl-F6uwith_cwdNT(uinterpurestart_subprocessuTrue(uselfuevent((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu restart_shellÞsuPyShell.restart_shellc Csl|jƒyttjƒ}Wnd}YnX|jj|ƒ|jjddƒ|jƒ|j j ƒdS(Nuuinsertuend-1c( u resetoutputustrusysups1uconsoleuwriteutextumark_setuset_line_and_columnuiou reset_undo(uselfus((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu showpromptâs   uPyShell.showpromptcCs€|jjddƒ}|jr1|jj|ƒn|jjdƒdkr_|jjddƒn|jjddƒ|jƒdS(Nuiomarkuend-1cuend-2cu (utextugetuhistoryustoreuinsertumark_setuset_line_and_column(uselfusource((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu resetoutputís uPyShell.resetoutputc Csñt|tƒryt|ƒryt|ƒdkryx*t|ƒD]\}}|dkr:Pq:q:Wtd|||ddƒ‚nyB|jjddƒtj |||dƒ}|jjddƒWn ‚YnX|j ríd|_ t sít ‚qín|S( Nuï¿¿uUCS-2iu%Non-BMP character not supported in Tkuiomarkurightulefti( u isinstanceustrulenumaxu enumerateuUnicodeEncodeErrorutextu mark_gravityu OutputWindowuwriteucanceleduuse_subprocessuKeyboardInterrupt(uselfusutagsustartucharucount((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuwriteös"-     u PyShell.writec sFy |jjdddƒrdSWntk r8dSYnXtƒjƒS(Nu sel.firstu(utags(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuname&suPseudoFile.namecCsdS(NT(uTrue(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuisatty*suPseudoFile.isattyN( u__name__u __module__u __qualname__uNoneu__init__upropertyuencodingunameuisatty(u __locals__((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu PseudoFilesu PseudoFilecBs,|EeZdZdd„Zdd„ZdS(uPseudoOutputFilecCsdS(NT(uTrue(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuwritable0suPseudoOutputFile.writablecCs}|jrtdƒ‚nt|ƒtk rgt|tƒsUtdt|ƒjƒ‚ntj|ƒ}n|jj ||j ƒS(Nuwrite to closed fileumust be str, not ( uclosedu ValueErrorutypeustru isinstanceu TypeErroru__name__u__str__ushelluwriteutags(uselfus((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuwrite3s uPseudoOutputFile.writeN(u__name__u __module__u __qualname__uwritableuwrite(u __locals__((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuPseudoOutputFile.s uPseudoOutputFilecBsY|EeZdZd dd„Zdd„Zd dd„Zddd „Zd d „Zd S(uPseudoInputFilecCs#tj||||ƒd|_dS(Nu(u PseudoFileu__init__u _line_buffer(uselfushellutagsuencoding((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu__init__@suPseudoInputFile.__init__cCsdS(NT(uTrue(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyureadableDsuPseudoInputFile.readableicCs|jrtdƒ‚n|dkr-d}n+t|tƒsXtdt|ƒjƒ‚n|j}d|_|dkr¢xˆ|j j ƒ}|s’Pn||7}qyn_x9t |ƒ|krÝ|j j ƒ}|sÐPn||7}q¥W||d…|_|d|…}|S(Nuread from closed fileiumust be int, not uiiÿÿÿÿ( uclosedu ValueErroruNoneu isinstanceuintu TypeErrorutypeu__name__u _line_bufferushellureadlineulen(uselfusizeuresultuline((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyureadGs,      uPseudoInputFile.readcCsÚ|jrtdƒ‚n|dkr-d}n+t|tƒsXtdt|ƒjƒ‚n|jpm|j j ƒ}|dkr‹t |ƒ}n|j dd|ƒ}|dkr¹|d}n||d…|_|d|…S(Nuread from closed fileiumust be int, not iu iÿÿÿÿ( uclosedu ValueErroruNoneu isinstanceuintu TypeErrorutypeu__name__u _line_bufferushellureadlineulenufind(uselfusizeulineueol((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyureadline^s      uPseudoInputFile.readlinecCs|jjƒdS(N(ushelluclose(uself((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuclosensuPseudoInputFile.closeNiÿÿÿÿiÿÿÿÿ( u__name__u __module__u __qualname__uNoneu__init__ureadableureadureadlineuclose(u __locals__((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyuPseudoInputFile>s  uPseudoInputFileu‰ 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]. cs¥td+ƒd+ad,}d,}d,}d}d}d,}y)tjtjdd…dƒ\}}Wn_tjk r¾}z<tj j dt |ƒƒtj j t ƒtj dƒWYdd}~XnXx2|D]*\} } | dkrí| }d+}n| dkrd+}d+}n| dkrd+}n| dkrFtjj t ƒtj ƒn| d kr[d+}n| d krpd,an| d kr·| }tjj|ƒr—ntd |ƒtj ƒd+}n| d krÒd+}d+}n| dkrÆ| t_d+}qÆqÆW|r"|ddkr"tjjƒ}d+}nx=tttjƒƒD]&} tjjtj| ƒtj| |j:j<d)tjfƒ|r|j:j=|ƒqs|rs|j:j>|ƒ|j:j;|ƒqsn5|rst,j?t!ƒ}|rs|j:j<d*|ƒqsnxt+j@rŒt!jAƒqvWt!jBƒtd,ƒdS(.Niu c:deihnr:st:u Error: %s iu-cu-du-eu-hu-iu-nu-ruNo script file: u-su-tiu-uumainuGeneralueditor-on-startuputypeuboolu classNameuIdleuIconsuWindowsuidle.icoudefaultg!@g333333!@u.pngu.gifcs/g|]%}tjjˆd|ˆfƒ‘qS(u idle_%d%s(uosupathujoin(u.0usize(uextuicondir(u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu þs umain..ii i0cSsg|]}td|ƒ‘qS(ufile(u PhotoImage(u.0uiconfile((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyu s u IDLESTARTUPu PYTHONSTARTUPubif 1: import sys as _sys _sys.argv = %r del _sys u print('%s')TF(ii i0(Cucapture_warningsuTrueuuse_subprocessuFalseuNoneugetoptusysuargvuerrorustderruwriteustru usage_msguexitustdoutuosupathuisfileuprintuPyShellu shell_titleustdinureadurangeulenuabspathuappendudirnameuinsertugetcwduidleConfu GetOptionuTkurootujoinu__file__usystemu wm_iconbitmapu TkVersionu wm_iconphotou fixwordbreaksuwithdrawuPyShellFileListuflistu macosxSupportusetupAppuopenuremoveunewu open_shellurunningAsOSXAppudictutopulowerupyshellu open_debuggeruenvironugetuinterpuexecfileu runcommandu execsourceuprepend_syspathutkVersionWarningu inversedictumainloopudestroy(u enable_shellu enable_editudebugucmduscriptustartupuoptsuargsumsguouauiupathxufilenameudiru edit_startuiconfileu iconfilesuiconsushellutkversionwarning((uextuicondiru4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyumain§sô )                       $      !             umainu__main__(Kugetoptuosuos.pathureusocketu subprocessusysu threadingutimeutokenizeu tracebackutypesuiou linecacheucodeuInteractiveInterpreteruplatformupython_versionusystemutkinteru ImportErroruprintu __stderr__uexitutkinter.messageboxu messageboxu tkMessageBoxuidlelib.EditorWindowu EditorWindowu fixwordbreaksuidlelib.FileListuFileListuidlelib.ColorDelegatoruColorDelegatoruidlelib.UndoDelegatoru UndoDelegatoruidlelib.OutputWindowu OutputWindowuidlelib.configHandleruidleConfuidlelibuidleverurpcuDebuggeruRemoteDebuggeru macosxSupportuHOSTuPORTuwarning_streamuwarningsuNoneuidle_formatwarninguidle_showwarningu_warnings_showwarningucapture_warningsuTrueu checkcacheuextended_linecache_checkcacheuPyShellEditorWindowuPyShellFileListuModifiedColorDelegatoruModifiedUndoDelegatoru RPCClientu MyRPCClientuModifiedInterpreteruPyShellu TextIOBaseu PseudoFileuPseudoOutputFileuPseudoInputFileu usage_msgumainu__name__umodulesuFalse(((u4/opt/alt/python33/lib64/python3.3/idlelib/PyShell.pyus~                     µÿÄÿßg ™