a 9êdgZàã @sÐddlZedkr ejdejd<z ddlTWn(eyTedejdedƒ‚Yn0ejdkršz ddl Z dZ e   d ¡  e ¡Wnee efy˜Yn0dd lmZed krìeƒat ¡dd lmZetƒejd detdedƒ‚ddlmZddlZddlZddlZddlmZddlZddlZddlZddl m!Z!ddl"Z"ddl#Z#ddl$Z$ddl%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl*m,Z,ddl-m.Z.m/Z/ddl0m1Z1ddl2m3Z3ddl*m4Z4ddlm5Z5m6Z6m7Z7ddl8m9Z9dZ:dZ;ejad d!„Z?e?d"ƒdej@fd#d$„ZAeAe_@Gd%d&„d&e.ƒZBGd'd(„d(e1ƒZCGd)d*„d*e'ƒZDGd+d,„d,e9ƒZEGd-d.„d.e4jFƒZGd/d0„ZHGd1d2„d2eƒZIGd3d4„d4e3ƒZJd5d6„ZKd7ZLd8d9„ZMedkrÄeMƒe?d:ƒdS)<éNÚ__main__zidlelib.pyshell)Ú*zJ** IDLE can't import Tkinter. Your Python may not be configured for Tk. **©ÚfileéÚwin32Zshcore)Ú messageboxg!@©Ú fix_scalingzIdle Cannot Startz"Idle requires tcl/tk 8.5+, not %s.©Úparent)ÚInteractiveInterpreter)Úpython_version)Ú TextWrapper)ÚColorDelegator)ÚidleConf©Údebugger)Ú debugger_r)Ú EditorWindowÚ fixwordbreaks)ÚFileList)Ú OutputWindow)Úrpc)Úidle_formatwarningÚ StdInputFileÚ StdOutputFile)Ú UndoDelegatorz 127.0.0.1c CsN|dur t}z&| t|||||d¡| d¡WnttfyHYn0dS)N)Úlineú>>> )Úwarning_streamÚwriterÚAttributeErrorÚOSError)ÚmessageÚcategoryÚfilenameÚlinenorr©r(ú+/usr/local/lib/python3.9/idlelib/pyshell.pyÚidle_showwarningEs ÿr*cCs0|rtdur,tjatt_ntdur,tt_dadS©N)Ú_warnings_showwarningÚwarningsÚ showwarningr*)Úcapturer(r(r)Úcapture_warningsXsr0TcCsXtj}i}t|ƒD].}|dd…|dd…dkr| |¡||<q||ƒ| |¡dS©Nréÿÿÿÿz<>)Ú linecacheÚcacheÚlistÚpopÚupdate)r&Zorig_checkcacher4ÚsaveÚkeyr(r(r)Úextended_linecache_checkcachegs  r:c@sreZdZdd„Zgd¢Zddd„Zdd„Zdd d „Zdd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zd S)ÚPyShellEditorWindowcGs–g|_tj|g|¢RŽ|j d|j¡|j d|j¡|j d|jj¡t j   t j d¡|_|jj|fdd„}|j |¡|jjrŠ| ¡| ¡dS)Nú<>ú<>z<>zbreakpoints.lstcSs| ¡|ƒdSr+)Úrestore_file_breaks)Zold_hookÚselfr(r(r)Úfilename_changed_hookŒsz;PyShellEditorWindow.__init__..filename_changed_hook)Ú breakpointsrÚ__init__ÚtextÚbindÚset_breakpoint_hereÚclear_breakpoint_hereÚflistÚ open_shellÚosÚpathÚjoinrZuserdirÚbreakpointPathÚioZfilename_change_hookZset_filename_change_hookr&r>Úcolor_breakpoint_text)r?Úargsr@r(r(r)rBsÿÿ  zPyShellEditorWindow.__init__))ZCutz<>Úrmenu_check_cut)ZCopyz<>Zrmenu_check_copy)ZPastez <>Úrmenu_check_paste)NNN)zSet Breakpointr<N)zClear Breakpointr=NTcCsD|jdurdS|r(t ¡}t |d¡}n dddœ}|j d|¡dS)NÚbreakÚ)Ú foregroundÚ backgroundÚBREAK)rMrÚ CurrentThemeÚ GetHighlightrCZ tag_config)r?ZcolorÚthemeZcfgr(r(r)rNžs  z)PyShellEditorWindow.color_breakpoint_textcCs†|j}|jj}| dd|d|d¡z|j |¡WntyV|j |¡Yn0z|jj j j }|  ||¡Wn Yn0dS)NrVz%d.0r) rCrMr&Útag_addrAÚindexÚ ValueErrorÚappendrGÚpyshellÚinterprrE)r?r'rCr&Údebugr(r(r)Úset_breakpointªs  z"PyShellEditorWindow.set_breakpointNcCs>|j}|jj}|s| ¡dStt| d¡ƒƒ}| |¡dS)NÚinsert)rCrMr&ÚbellÚintÚfloatr[ra)r?ÚeventrCr&r'r(r(r)rE¸sz'PyShellEditorWindow.set_breakpoint_herecCsŠ|j}|jj}|s| ¡dStt| d¡ƒƒ}z|j |¡Wn Yn0|  ddd¡z|j j j j }| ||¡Wn Yn0dS)NrbrVúinsert linestartzinsert lineend +1char)rCrMr&rcrdrer[rAÚremoveÚ tag_removerGr^r_rrF)r?rfrCr&r'r`r(r(r)rFÁs$ÿ z)PyShellEditorWindow.clear_breakpoint_herecCsd|jr`|j}|jj}|s$| ¡dSg|_| ddt¡z|jjj j }|  |¡Wn Yn0dS)NrVú1.0) rArCrMr&rcriZENDrGr^r_rÚclear_file_breaks)r?rCr&r`r(r(r)rkÔs z%PyShellEditorWindow.clear_file_breaksc Cs:|j}|jj}z8t|jdƒ}| ¡}Wdƒn1s:0YWnty\g}Yn0z~t|jdƒ^}|D]}| |d¡sr| |¡qr|  ¡|j}|r¼| |dt |ƒd¡Wdƒn1sÐ0YWnXty4}z>t |j ddƒs d|j _ tjdd t |ƒ|jd WYd}~n d}~00dS) NÚrÚwú=Ú Úbreakpoint_error_displayedFTz IDLE Errorz$Unable to update breakpoint list: %s)Útitler$r )rArMr&ÚopenrLÚ readlinesr#Ú startswithr!Úupdate_breakpointsÚstrÚgetattrÚrootrprÚ showerrorrC)r?Zbreaksr&ÚfpÚlinesZnew_filerÚerrr(r(r)Ústore_file_breaksãs2*   <ÿýz%PyShellEditorWindow.store_file_breakscCs¶|j ¡|jdurdS|jj}|dur,dStj |j¡r²t|jdƒ}|  ¡}Wdƒn1sd0Y|D]>}|  |d¡rrt |t |ƒdd…ƒ}|D]}|  |¡q qrdS)Nrlrnr)rCr7rMr&rIrJÚisfilerLrrrsrtÚevalÚlenra)r?r&rzr{rZbreakpoint_linenumbersZbreakpoint_linenumberr(r(r)r> s  &z'PyShellEditorWindow.restore_file_breakscCs$|j}| d¡}| |¡}||_dS)NrV)rCZ tag_rangesÚranges_to_linenumbersrA)r?rCÚrangesZlinenumber_listr(r(r)rus  z&PyShellEditorWindow.update_breakpointscCsbg}tdt|ƒdƒD]H}tt||jƒƒ}tt||djƒƒ}||kr| |¡|d7}q@q|S)Nrér)Úranger€rdreÚstringr])r?r‚r{r[r'Úendr(r(r)r%s  z)PyShellEditorWindow.ranges_to_linenumberscCs| ¡t |¡dSr+)rkrÚ_close©r?r(r(r)r‡6szPyShellEditorWindow._close)T)N)N)Ú__name__Ú __module__Ú __qualname__rBÚ rmenu_specsrNrarErFrkr}r>rurr‡r(r(r(r)r;~s  *r;c@seZdZeZdZddd„ZdS)ÚPyShellFileListNcCs8|jr|jj ¡nt|ƒ|_|jr2|j ¡s2dS|jSr+)r^ÚtopÚwakeupÚPyShellÚbegin©r?rfr(r(r)rHEs  zPyShellFileList.open_shell)N)r‰rŠr‹r;rr^rHr(r(r(r)r<src@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) ÚModifiedColorDelegatorcCst |¡| ¡dSr+)rrBÚ LoadTagDefsrˆr(r(r)rBSs zModifiedColorDelegator.__init__cCs*| ddd¡| ddd¡t |¡dS)NZTODOrjÚiomarkZSYNC)rirZrÚrecolorize_mainrˆr(r(r)r–Wsz&ModifiedColorDelegator.recolorize_mainc CsJt |¡t ¡}|j dddœt |d¡t |d¡t |d¡dœ¡dS)N)rUrTÚstdoutÚstderrÚconsole)Ústdinr—r˜r™)rr”rrWÚtagdefsr7rX)r?rYr(r(r)r”\s    üz"ModifiedColorDelegator.LoadTagDefscCs|jD]}| |dd¡qdS)Nr•r†)r›ri)r?Útagr(r(r)Ú removecolorsfs z#ModifiedColorDelegator.removecolorsN)r‰rŠr‹rBr–r”rr(r(r(r)r“Ps r“c@s eZdZddd„Zddd„ZdS)ÚModifiedUndoDelegatorNcCsLz$|j |dd¡r"|j ¡WdSWnty6Yn0t ||||¡dS©Nú„Z%dS)CÚModifiedInterpretercCsB||_tjdj}tj||dd|_d|_t|_ |j j j |_ dS)Nr)ÚlocalsF)Ú tkconsoleÚsysÚmodulesÚ__dict__r rBÚ restartingÚsubprocess_arglistÚPORTÚportÚcompileÚcompilerÚflagsÚoriginal_compiler_flags)r?r²r±r(r(r)rB—s zModifiedInterpreter.__init__NcCs&|jdur| ¡|_t |j¡|_dSr+)r·Úbuild_subprocess_arglistÚ subprocessÚPopenÚ rpcsubprocrˆr(r(r)Úspawn_subprocess¤s  z$ModifiedInterpreter.spawn_subprocesscCsJdd„tjDƒ}tjdddddd}d |f}tjg|d |t|jƒgS) NcSsg|] }d|‘qS)z-Wr()Ú.0Úsr(r(r)Ú ¬óz@ModifiedInterpreter.build_subprocess_arglist..ÚmainÚGeneralzdelete-exitfuncFÚbool)ÚdefaultÚtypez&__import__('idlelib.run').run.main(%r)ú-c)r³Ú warnoptionsrÚ GetOptionÚ executablervr¹)r?rmZ del_exitfZcommandr(r(r)r¾©s  ÿ z,ModifiedInterpreter.build_subprocess_arglistc CsXt|jf}tdƒD]6}t |¡zt|ƒ|_WqVWqtyFYq0q| ¡dS|jj   ¡d|_t dkr†|jj   t jt jd¡| ¡|jj  d¡z|j ¡Wnt jyÈ| ¡YdS0|j d|j¡|j d|jj¡|j d|jj¡|j d|jj¡|j d |jj¡|j d t¡|j d |¡|jd d | ¡|jS)Nérré r™ršr—r˜rGr3r_T©Úwith_cwd)ÚHOSTr¹r„ÚtimeÚsleepr¨Úrpccltr#Údisplay_port_binding_errorÚlistening_sockÚ getsocknamer¸Ú setsockoptÚsocketÚ SOL_SOCKETÚ SO_REUSEADDRrÂÚ settimeoutÚacceptÚtimeoutÚdisplay_no_subprocess_errorÚregisterr²ršr—r˜rGr3Ú transfer_pathÚpoll_subprocess)r?ÚaddrÚir(r(r)Ústart_subprocessµs@       ÿ z$ModifiedInterpreter.start_subprocessFrScCs0|jr |jSd|_| ¡}|r>ÚERRORz/pyshell.ModifiedInterpreter: Subprocess ERROR: )r×Z pollresponseÚ active_seqr©r#ÚKeyboardInterruptr²ÚclosingrõÚ resetoutputr™ÚprintÚreprÚgetvarÚremote_stack_viewerr³Ú __stderr__Ú endexecutingr"rCÚafterÚ pollintervalrårþ)r?ZcltÚresponseÚhowZwhatr™Úerrmsgr(r(r)rå=sB     ÿz#ModifiedInterpreter.poll_subprocesscCs ||_dSr+r)r?rr(r(r)Ú setdebuggereszModifiedInterpreter.setdebuggercCs|jSr+rrˆr(r(r)rìhszModifiedInterpreter.getdebuggercCs|jj d|j¡dS)Ni,)r²rCrr rˆr(r(r)Úopen_remote_stack_viewerks z,ModifiedInterpreter.open_remote_stack_viewerc Cs°ddlm}|j dddi¡}|dur6|jj ¡dS| |j|¡}ddlm }m }t |jjƒ}t   ¡}t  |d¡d}|||dd } | jjd d d || jd|ƒ} |  ¡dS) Nr)Ú debugobj_rröZ stackviewer)rG)ÚScrolledCanvasÚTreeNodeÚnormalrU)ÚbgZhighlightthicknessrZboth)ÚexpandÚfill)Úidlelibrr×Ú remotequeuer²rxrcZStubObjectTreeItemZ idlelib.treerrZToplevelrrWrXÚframeÚpackZcanvasr) r?rZoidÚitemrrrŽrYrUZscZnoder(r(r)r xs   z'ModifiedInterpreter.remote_stack_viewerrcCs| |¡}| ||¡dSr+)Ú stuffsourceÚexecfile©r?Úsourcer&r(r(r)Ú execsource‹s zModifiedInterpreter.execsourcec CsÀ|durZt |¡8}| ¡}trd|j}|jd|_| d¡}t|ƒdd||ftj|<|S)Nz rror)ÚgidÚsplitr€r3r4)r?r&r&r{r(r(r)r#­s    zModifiedInterpreter.stuffsourcecCs| d|f¡dS)Na(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 )r©r?r&r(r(r)Úprepend_syspathµsøz#ModifiedInterpreter.prepend_syspathc CsÄ|j}|j}| ddd¡t ¡\}}}t|ddƒp:|p:d}t|ddƒpJd}t|d dƒpZd } | d krl|d7}|dkr‚d | d} nd |d| df} | || ¡| ¡| d |¡|  ¡dS)Nrrjr†ÚmsgrSzr'rÚoffsetrziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s ) r²rCrir³Úexc_inforwZcolorize_syntax_errorr r!ró) r?r&r²rCrËÚvalueÚtbr6r'r7Úposr(r(r)r.Ás$ÿ z#ModifiedInterpreter.showsyntaxerrorcCs6|j ¡| ¡t |¡|j d¡r2|j ¡dS)Nr)r²r Úchecklinecacher Ú showtracebackr Úopen_stack_viewerrˆr(r(r)r=Ûs    z!ModifiedInterpreter.showtracebackcCs>tj}t| ¡ƒD]&}|dd…|dd…dkr||=qdSr1)r3r4r5Úkeys)r?Úcr9r(r(r)r<ãsz"ModifiedInterpreter.checklinecachecCs@|jjr| ¡dS|jr0|j dd|fi¡n t||jƒdS)Nrrör/r)r²rïÚdisplay_executing_dialogr×rrör±)r?r0r(r(r)rés zModifiedInterpreter.runcommandcCst|jjr| ¡| ¡|j}z"zT|j ¡|sT|jdurT|j dd|fi¡|_n |rh|  ||j ¡n t ||j ƒWnžt y¶|jj s°tjddd|jjdr¦‚q²| ¡n‚Yn`trätd|jjd| ¡|j ¡n,|jjrd |j_td |jjdn| ¡Yn0Wtspz|j ¡Wnty@Yn0n,tsnz|j ¡WntylYn00dS) Nrör/zExit?zDo you want to exit altogether?Zyes©rÊr z IDLE internal error in runcode()rFr)r²rïrõr<rÚbeginexecutingr×Z asyncqueuerÚrunr±röÚ SystemExitrrZaskyesnorCr=r*r r˜rÚcanceledr")r?r0rr(r(r)r/õsZ  ÿ ü ÿ  üzModifiedInterpreter.runcodecCs|jj |¡Sr+)r²r˜r!)r?rÄr(r(r)r!#szModifiedInterpreter.writecCstjdd|jjddS)NzPort Binding ErroraAIDLE 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.r ©rryr²rCrˆr(r(r)rØ's øz.ModifiedInterpreter.display_port_binding_errorcCstjdd|jjddS)NzSubprocess Connection Errorz¢IDLE's subprocess didn't make connection. See the 'Startup failure' section of the IDLE doc, online at https://docs.python.org/3/library/idle.html#startup-failurer rGrˆr(r(r)râ2s ûz/ModifiedInterpreter.display_no_subprocess_errorcCstjdd|jjddS)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.r rGrˆr(r(r)rA:s üz,ModifiedInterpreter.display_executing_dialog)FrS)F)N)N)&r‰rŠr‹rBrþr×rÁrÂr¾rèrõrúrürÿrîrärrårrrìrr r2r'r$r1r#r5r.r=r<rr/r!rØrârAr(r(r(r)r°•sF  + , &     . r°cs’eZdZdeƒZeZeZgd¢Z e j dgZ dZ ddl mZdPdd „Zd d „ZdZdZdZdZdZdZd d „Zdd„ZdQdd„Zdd„ZdRdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z d d!„Z!d"d#„Z"d$d%„Z#d&d'„Z$d(Z%d)d*„Z&d+d,„Z'd-d.„Z(d/d0„Z)dSd1d2„Z*d3d4„Z+d5d6„Z,d7d8„Z-d9d:„Z.d;d<„Z/dTd=d>„Z0dUd?d@„Z1dVdAdB„Z2dCdD„Z3dEdF„Z4dGdH„Z5dWdJdK„Z6‡fdLdM„Z7‡fdNdO„Z8‡Z9S)Xrz IDLE Shell ))rZ_File)ZeditZ_Edit)r`Z_Debug)ÚoptionsZ_Options)ZwindowZ_Window)ÚhelpZ_Help)ZSqueezeú<>Fr)ÚHistoryNcCs$tr&|j}|dddkr&| dd¡t|ƒ|_|durVtƒ}t|ƒ| ¡t|ƒ}t   ||dd¡d|_ d|_ t tdƒr‚tjnd|_|j d ¡d |_|j|_|j}|jd d | d |j¡| d|j¡| d|j¡| d|j¡| d|j¡| d|j¡| d|j¡tr8| d|j¡| d|j¡|  |¡}| d|j!¡tj"|_#tj$|_%tj&|_'ddl(m)}t*|d|j+|j,ƒ|_&t-|d|j+|j,ƒ|_"t-|d|j+dƒ|_$t-|d|j+|j,ƒ|_.tsà|j"t_"|j$t_$|j&t_&zddl/}|j0|_1Wntj2t_$‚Yn0| 3|j¡|_4d|_5dS)NrƒrÚshell)rLZShe_llTéÚps1rror2Úchar)Úwrapz<>z<>z<>z<>z<>ú<>rz<>z<>rJ)Úiomenuršr—r˜Úbackslashreplacer™é2)6r*Ú menu_specsrbr°r_ÚTkrÚwithdrawrrrBZusetabsZ indentwidthÚhasattrr³rNÚsys_ps1r3Zprompt_last_lineÚpromptrCZ configurerDÚenter_callbackÚlinefeed_callbackÚcancel_callbackÚ eof_callbackr>Útoggle_debuggerÚtoggle_jit_stack_viewerÚview_restart_markÚ restart_shellZSqueezerZsqueeze_current_text_eventr—Ú save_stdoutr˜Ú save_stderrršÚ save_stdinrrRrÚencodingÚerrorsrr™ÚpydocZ plainpagerZpagerrrKÚhistoryr)r?rGÚmsrxrCZsqueezerrRrhr(r(r)rB^sx    ÿ ÿÿÿÿ zPyShell.__init__cCs tjddS)NT)Z shell_only)rZ GetExtensionsrˆr(r(r)Úget_standard_extension_names¡sz$PyShell.get_standard_extension_namescCs|adSr+©r )r?Ústreamr(r(r)Úset_warning_stream«szPyShell.set_warning_streamcCstSr+rlrˆr(r(r)Úget_warning_stream¯szPyShell.get_warning_streamcCsH|jr$tjdd|jd| ¡dS|j ¡}|r<| ¡n| ¡dS)NzDon't debug nowz*You can only toggle the debugger when idler rR) rïrryrCÚset_debugger_indicatorr_rìÚclose_debuggerÚ open_debugger)r?rfÚdbr(r(r)r_²sþ  zPyShell.toggle_debuggercCs|j ¡}| d| ¡dS)NrQ)r_rìZsetvar©r?rsr(r(r)rpÀs zPyShell.set_debugger_indicatorcCsdSr+r(r’r(r(r)r`ÄszPyShell.toggle_jit_stack_viewercCsh|j ¡}|r\|j d¡| ¡|jjr8t |jj¡| ¡|j  d¡|j |_ |  ¡|  ¡dS)Nz [DEBUG OFF] )r_rìrrír×rZclose_remote_debuggerr r™r!rYrZrórprtr(r(r)rqÇs   zPyShell.close_debuggercCsX|jjrt |jj|¡}n t |¡}|j |¡| ¡d|j|_ |  ¡|  ¡dS)Nz [DEBUG ON] ) r_r×rZstart_remote_debuggerrZDebuggerrrôrYrZrórp)r?Zdbg_guir(r(r)rrÔs ÿ   zPyShell.open_debuggercCs |jr dnd}| dd|¡dS)NÚdisabledrr`z *tack*iewer)rïZupdate_menu_state)r?Ústater(r(r)Údebug_menu_postcommandàszPyShell.debug_menu_postcommandcCs| ¡d|_dS©NT)r rïrˆr(r(r)rCäszPyShell.beginexecutingcCsd|_d|_| ¡dSrý)rïrFrórˆr(r(r)részPyShell.endexecutingcCsD|jr&tjddd|jd}|dur&dS| ¡d|_d|_t |¡S)NzKill?z7Your program is still running! Do you want to kill it?ÚokrBFÚcancelT) rïrZ askokcancelrCrðrFrrrí)r?rr(r(r)ríïsüz PyShell.closecCsV| ¡tr|j ¡|jt_|jt_|j t_ d|_d|_ d|j _ d|_t |¡dSr+)rqr*r_rÿrcr³r—rdr˜reršr™rGr^rirr‡rˆr(r(r)r‡þs zPyShell._closecCsdSrxr(r4r(r(r)ÚispythonsourceszPyShell.ispythonsourcecCs|jSr+)Ú shell_titlerˆr(r(r)Ú short_titleszPyShell.short_titlezHType "help", "copyright", "credits" or "license()" for more information.cCsŒ|j dd¡| ¡tr:d}|j ¡}|sF| ¡dSn d}tjt _|  dt j t j |j |f¡|j ¡| ¡ddl}d|_d|_dS) Nr•rbrSFz›==== No Subprocess ==== WARNING: Running IDLE without a Subprocess is deprecated and will be removed in a later version. See Help/IDLE Help for details. zPython %s on %s %s %srT)rCrñr r*r_rèrírÚ displayhookr³r!ÚversionÚplatformÚ COPYRIGHTZ focus_forceróÚtkinterZ_support_default_rootZ _default_root)r?ZnosubÚclientr‚r(r(r)r‘s& ÿ z PyShell.begincCs|js dSd|_|j ¡dSrx)ÚreadingÚ_stop_readline_flagrŽÚquitrˆr(r(r)rð2szPyShell.stop_readlinecCsˆ|j}zd|_|j ¡W||_n||_0|jr:d|_dS|j dd¡}t|ƒdkrXd}| ¡|jrtd|_t stt ‚|j r„d|_ d}|S)NTFrSr•rérro) r„rŽÚmainloopr…rCÚgetr€r rFr*rÚ endoffile)r?r8rr(r(r)Úreadline8s(  zPyShell.readlinecCsdSrxr(rˆr(r(r)ÚisattyOszPyShell.isattycCs¢z|j ddd¡rWdSWn Yn0|jsT|jsT| ¡|j d¡| ¡dSd|_d|_ |jrŽ|jj rŽ|j  ¡r„|j  ¡n |j  ¡|jrž|j ¡dS)Nú sel.firstz!=úsel.lastzKeyboardInterrupt rRFT)rCr¢rïr„r r_r!rór‰rFr×rìrõrürŽr†r’r(r(r)r]Rs&       zPyShell.cancel_callbackcCsf|jr|jsdS|j ddd¡r0|j ddd¡s4dS|jsL| ¡| ¡nd|_d|_|j  ¡dS)Nr•z==rbréFTrR) rïr„rCr¢r rírFr‰rŽr†r’r(r(r)r^hs ÿ  zPyShell.eof_callbackcCs0|jr"|j dd¡|j d¡n | |¡dS)NrbrorR)r„rCrbÚseeÚnewline_and_indent_eventr’r(r(r)r\ws  zPyShell.linefeed_callbackcCs:|jr|jsdSz8|j dd¡}|rF|j ddd¡rF| ||¡WdSWn Yn0|j ddd¡rX|j d d¡}|r°|j dd|d ¡r°| |j |d |d ¡|¡dS|j d d¡}|rø|j d d |d ¡rø| |j |d |d ¡|¡dS|j dd¡}|r>|j |d dd¡r>| |j |d d ¡|¡n| |j dd ¡|¡dS|j ddd¡rx|j dd¡|j dd¡}|r¤|  ¡s¤|j  dd¡|j ddd¡rÄ|  |¡dS|j dd¡|jrö|j  dd¡|j  d¡n |  |¡|j d dd¡|j ¡|jr.|j ¡n| ¡dS)NrŒrz<=r•rRrbr úiomark linestartršrrzinsert lineendz>=r™rgrézend-1c linestartro)rïr„rCrˆr¢ÚrecallZ tag_prevrangeZ tag_nextrangerñÚstripr¦rrbrŽrZZupdate_idletasksrŽr†Úrunit)r?rfÚselÚprevÚnextÚindicesrÄr(r(r)r[€sZ   ÿ    zPyShell.enter_callbackc CsLt dd|¡}t dd|¡}| d¡}|j ¡zþ|j ddd¡|j dd ¡|j d d¡}| ¡  d ¡r„|  |¡|j d d¡}|j  d|d   ¡¡t |ƒd krt d|d ¡ d ¡}t d|¡ d ¡}|d d…D]8}| |¡rþ||t |ƒd…}|j  dd| ¡¡qÜW|j d¡|j ¡n|j d¡|j ¡0dS)Nz^\s*\nrSz\n\s*$ror”rjr†rbrérgú:rrz ^([ \t]*))ÚreÚsubr3rCZundo_block_startrirñrˆÚrstripÚendswithrrbr’r€ÚsearchÚgrouprtrŽZundo_block_stop)r?rÄrfr{ÚprefixZorig_base_indentZnew_base_indentrr(r(r)r‘¿s.      ÿ zPyShell.recallcCs–|j dd¡}t|ƒ}|dkr8||ddvr8|d}q|dkrX||ddkrX|d}|dkrz||ddvrz|d}qX|d|…}|j |¡dS)Nr•rérrz ro)rCrˆr€r_r1)r?rrçr(r(r)r“Ùs   z PyShell.runitcCs\|jjr|j ¡Sz tjWn tjdd|jdYdS0ddlm }||j |j ƒdS)NzNo stack tracez@There is no stack trace yet. (sys.last_traceback is not defined)r r)Ú StackBrowser) r_r×r r³Úlast_tracebackrryrCZidlelib.stackviewerr rxrG)r?rfr r(r(r)r>çs  ý zPyShell.open_stack_viewercCs|j d¡|j d¡dS)Nr•rê)rCrŽr’r(r(r)raõs zPyShell.view_restart_markcCs|jjdddS)NTrÒ)r_rõr’r(r(r)rbùszPyShell.restart_shellcCs:| ¡|j |j¡|j dd¡| ¡|j ¡dS)Nrbré) r r™r!rZrCrñÚset_line_and_columnrMZ reset_undorˆr(r(r)róýs zPyShell.showpromptcCsP|jjj}t|ddd}d | |¡¡}| d¡s:|d7}|jj  d|d¡dS)NrMT)r­ÚtabsizeZ expand_tabsrorr˜) r_r²r­rrKrPrœZperZbottomrb)r?r6r­ÚwrapperZ wrapped_msgr(r(r)Ú show_warnings   zPyShell.show_warningcCsb|j dd¡}|jr |j |¡|j d¡dkr>|j dd¡|j dd¡| ¡|j ¡dS)Nr•rézend-2cro) rCrˆriÚstorerbrñr¢ZctipZremove_calltip_window)r?r&r(r(r)r  s zPyShell.resetoutputr(cCsXz0|j dd¡t |||d¡}|j dd¡Wn‚Yn0|jrTd|_tsTt‚|S)Nr•ÚrightrëF)rCròrr!rFr*r)r?rÄr¥Úcountr(r(r)r!sz PyShell.writecs:z|j ddd¡rWdSWnty.YdS0tƒ ¡S)NrŒr r•ru)rCr¢r£ÚsuperrPrˆ©Ú __class__r(r)rP$s   zPyShell.rmenu_check_cutcs|j ddd¡rdStƒ ¡S)Nrbr r•ru)rCr¢r©rQrˆrªr(r)rQ,szPyShell.rmenu_check_paste)N)N)N)N)N)N)N)r():r‰rŠr‹rr|r“rržrrUrrŒZallow_line_numbersZidlelib.historyrKrBrkr„rïrFr‰rr…rnror_rpr`rqrrrwrCrrír‡r{r}rr‘rðrŠr‹r]r^r\r[r‘r“r>rarbrór¥r r!rPrQÚ __classcell__r(r(rªr)rBsh  ÿ  C    ÿ  ?     rc Cs2|jdkr.dD]}| |dd| |d¡¡qdS)NZx11)ÚTextZEntryZSpinboxz <>z%catch {%W delete sel.first sel.last} )Z_windowingsystemZ bind_class)rxÚclsr(r(r)Ú fix_x11_paste2s  ÿýr¯a¢ 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 (DEPRECATED, 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]. c s\ddl}ddlm}ddlm}ddlm}tdƒdad}d}d}d}d}d} z| tj dd…d¡\} } WnF|j y´} z,t d | t ftj d t d ¡WYd} ~ n d} ~ 00| D]Ô\} }| d krÒ|}d}| d krâd}d}| dkrîd}| dkr tj t ¡t ¡| dkrd}| dkr6t dtj d da| dkrj|}tj |¡rTnt d|ƒt ¡d}| dkr|d} d}| dkrº|t_d}qº| r²| ddkr²tj ¡}d}tttjƒƒD]}tj tj|¡tj|<qÀ| r | ddkr dg| dd…t_ nª|rd g| t_ n–|r2|g| t_ n‚| r’d}g}| D]}| tj |¡¡qD|D],}tj |¡}|tjvrbtj d|¡qbn"t ¡}|tjvr´tj d|¡tj ddddd}|pÎ|}|pÚ| }trî|sît!ƒt"dda#t# $¡dd l%m&}|t#ƒtj 'tj t(¡d!¡‰|ƒd"krRtj 'ˆd#¡}t#j)|d$nZ| *¡s¬t+d%krpd&‰d'}nd(‰d)}‡‡fd*d+„|Dƒ}d,d+„|Dƒ}t#j,dg|¢RŽt-t#ƒt.t#ƒt/t#ƒa0| 1t#t0¡|r|s|s| dd…D] }t0 2|¡durî|  3|¡qî| st0 4¡|rTt0 5¡}|s6dS| *¡rZt0j6rZ|j7 8¡nt0j9}|rh| :¡| r¨tj; |¡|s´|rü|j= ?d/tj f¡|rÜ|j= @|¡n|r4|j= A|¡|j= >|¡n8|r4| Bt#¡}|r| C|¡| D¡}|r4| C|¡t0jErHt# F¡q4t# G¡tdƒdS)0Nr)Úsystem)Útesting)ÚmacosxTFrz c:deihnr:st:z Error: %s %srrƒrÌz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-tú-rSrÇrÈzeditor-on-startuprÉ)rËZIdle)Z classNamer ZIconsZWindowszidle.ico)rÊg333333!@z.png)éé é0éz.gif)r´rµr¶cs"g|]}tj ˆd|ˆf¡‘qS)z idle_%d%s)rIrJrK)rÃÚsize©ÚextZicondirr(r)rÅÜsÿzmain..cSsg|]}tt|d‘qS))Zmasterr)Z PhotoImagerx)rÃÚiconfiler(r(r)rÅÞsÿZ IDLESTARTUPZ PYTHONSTARTUPzbif 1: import sys as _sys _sys.argv = %r del _sys )HÚgetoptr€r°rr±r²r0r*r³ÚargvÚerrorr Ú usage_msgr˜Úexitr—r!rIrJr~rr|ršr)r„r€r+r]ÚdirnamerbÚgetcwdrrÎZ NoDefaultRootrVrxrWÚ idlelib.runr rKÚ__file__Z wm_iconbitmapZisAquaTkÚ TkVersionZ wm_iconphotorr¯rrGZsetupApprrrhÚnewrHÚdictrŽÚlowerr^rrÚenvironrˆr_r$rr'r5ZtkVersionWarningr¥ZpreferTabsPreferenceWarningZ inversedictr‡Zdestroy)r¼r°r±r²Z enable_shellZ enable_editr`ÚcmdZscriptZstartupZoptsrOr6ÚoÚarçZpathxr&ÚdirZ edit_startr r»ZsizesZ iconfilesZiconsrLZtkversionwarningZprefer_tabs_preference_warningr(r¹r)rÇss$         ÿ       ÿ         ÿÿ    ÿ  ü     rÇF)NN)Nr³r‰r´r‚Ú ImportErrorr rrEr€ZctypesZPROCESS_SYSTEM_DPI_AWAREZOleDLLZSetProcessDpiAwarenessr"r#rrÅrVrxrWrÃr ryr0r r3rIZos.pathrr™rÜr¿ÚtextwraprrørÕr(r-Zidlelib.colorizerrZidlelib.configrrrrZidlelib.editorrrZidlelib.filelistrZidlelib.outwinrrrrrZ idlelib.undorrÔr¸r r*r,r0Ú checkcacher:r;rr“ržZ RPCClientr¨r¯r°rr¯r¿rÇr(r(r(r)Ús¨  ÿ   þ           ÿ  ÿ ?0s 66