<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

e fR                 @   sV  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l Z d  d l m Z d  d l m Z m Z y d  d l TWn2 e k
 r e d d e j e j d  Yn Xd  d l j Z d  d l m Z m Z d  d	 l m Z d  d
 l m Z d  d l  m! Z! d  d l" m# Z# d  d l$ m% Z% d  d l& m' Z' d  d l& m( Z( d  d l& m) Z) d  d l& m* Z* d Z+ d  Z, e j a- d  d l. Z. d d d  Z/ d d d d  Z0 d a1 d d   Z2 e2 d  d e j3 d d  Z4 e4 e _3 Gd d   d e  Z5 Gd d   d e  Z6 Gd  d!   d! e  Z7 Gd" d#   d# e!  Z8 Gd$ d%   d% e' j9  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>  Z@ d0 ZA d1 d2   ZB eC d3 k rHe jD d3 e jD d) <eB   n  e2 d4  d S)5    N)InteractiveInterpreter)python_versionsystem)*zJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **file   )EditorWindowfixwordbreaks)FileList)ColorDelegator)UndoDelegator)OutputWindow)idleConf)rpc)Debugger)RemoteDebugger)macosxSupportz	127.0.0.1c             C   sy   d } | d | | f 7} | d k r; t  j | |  } n  | j   } | r^ | d | 7} n  | d | j |  f 7} | S)zFormat warnings the IDLE way.z!
Warning (from warnings module):
z  File "%s", line %s
Nz    %s
z%s: %s
)	linecachegetlinestrip__name__)messagecategoryfilenamelinenolines r   4/opt/alt/python34/lib64/python3.4/idlelib/PyShell.pyidle_formatwarning0   s    r   c             C   sg   | d k r t  } n  y3 | j t |  | | | d |  | j d  Wn t t f k
 rb Yn Xd S)a   Show Idle-format warning (after replacing warnings.showwarning).

    The differences are the formatter called, the file=None replacement,
    which can be None, the capture of the consequence AttributeError,
    and the output of a hard-coded prompt.
    Nr   z>>> )warning_streamwriter   AttributeErrorOSError)r   r   r   r   r   r   r   r   r   idle_showwarning=   s    		r$   c             C   sL   |  r* t  d k rH t j a  t t _ qH n t  d k	 rH t  t _ d a  n  d S)z>Replace warning.showwarning with idle_showwarning, or reverse.N)_warnings_showwarningwarningsshowwarningr$   )Zcapturer   r   r   capture_warningsP   s    		r(   Tc             C   s{   t  j } i  } xN t |  D]@ } | d d  | d d  d k r | j |  | | <q q W| |   | j |  d S)ao  Extend linecache.checkcache to preserve the <pyshell#...> entries

    Rather than repeating the linecache code, patch it to save the
    <pyshell#...> 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.
    Nr   z<>)r   cachelistpopupdate)r   Zorig_checkcacher*   savekeyr   r   r   extended_linecache_checkcache_   s    	$
r0   c               @   s   e  Z d  Z d Z d d   Z d' d( d) d* d+ d, g Z d d d  Z d d   Z d d d  Z d d d  Z	 d d   Z
 d d   Z d d    Z d! d"   Z d# d$   Z d% d&   Z d S)-PyShellEditorWindowz6Regular text edit window in IDLE, supports breakpointsc             G   s   g  |  _  t j |  |  |  j j d |  j  |  j j d |  j  |  j j d |  j j  t	 j
 j t j   d  |  _ |  j j |  d d  } |  j j |  |  j j r |  j   n  |  j   d  S)Nz<<set-breakpoint-here>>z<<clear-breakpoint-here>>z<<open-python-shell>>zbreakpoints.lstc             S   s   | j    |    d  S)N)restore_file_breaks)Zold_hookselfr   r   r   filename_changed_hook   s    
z;PyShellEditorWindow.__init__.<locals>.filename_changed_hook)breakpointsr   __init__textbindset_breakpoint_hereclear_breakpoint_hereflist
open_shellospathjoinr   ZGetUserCfgDirbreakpointPathioZfilename_change_hookZset_filename_change_hookr   r2   color_breakpoint_text)r3   argsr4   r   r   r   r6   y   s    		zPyShellEditorWindow.__init__Cut<<cut>>rmenu_check_cutCopy<<copy>>rmenu_check_copyPaste	<<paste>>rmenu_check_pasteNSet Breakpoint<<set-breakpoint-here>>Clear Breakpoint<<clear-breakpoint-here>>Tc             C   se   |  j  d k r d S| r: t j   } t j | d  } n i d d 6d d 6} |  j j d |  d S)z,Turn colorizing of breakpoint text on or offNbreak 
foreground
backgroundBREAK)rA   r   CurrentThemeGetHighlightr7   Z
tag_config)r3   ZcolorthemeZcfgr   r   r   rB      s    z)PyShellEditorWindow.color_breakpoint_textc             C   s   |  j  } |  j j } | j d d | d | d  y |  j j |  Wn" t k
 rl |  j j |  Yn Xy& |  j j	 j
 j } | j | |  Wn Yn Xd  S)NrU   z%d.0r   )r7   rA   r   tag_addr5   index
ValueErrorappendr;   pyshellinterpdebuggerr9   )r3   r   r7   r   debugr   r   r   set_breakpoint   s    	z"PyShellEditorWindow.set_breakpointc             C   sU   |  j  } |  j j } | s) | j   d  St t | j d    } |  j |  d  S)Ninsert)r7   rA   r   bellintfloatrZ   ra   )r3   eventr7   r   r   r   r   r   r9      s    	
z'PyShellEditorWindow.set_breakpoint_herec             C   s   |  j  } |  j j } | s) | j   d  St t | j d    } y |  j j |  Wn Yn X| j	 d d d  y& |  j
 j j j } | j | |  Wn Yn Xd  S)Nrb   rU   zinsert linestartzinsert lineend +1char)r7   rA   r   rc   rd   re   rZ   r5   remove
tag_remover;   r]   r^   r_   r:   )r3   rf   r7   r   r   r`   r   r   r   r:      s"    	
z)PyShellEditorWindow.clear_breakpoint_herec          	   C   s   |  j  r |  j } |  j j } | s2 | j   d  Sg  |  _  | j d d t  y# |  j j j	 j
 } | j |  Wq Yq Xn  d  S)NrU   z1.0)r5   r7   rA   r   rc   rh   ZENDr;   r]   r^   r_   clear_file_breaks)r3   r7   r   r`   r   r   r   ri      s    		
	z%PyShellEditorWindow.clear_file_breaksc             C   sb  |  j  } |  j j } y+ t |  j d   } | j   } Wd QXWn t k
 rZ g  } Yn Xy t |  j d  v } x1 | D]) } | j | d  sz | j |  qz qz W|  j	   |  j  } | r | j | d t
 |  d  n  Wd QXWnr t k
 r]} zR t |  j d d  sKd |  j _ t j d	 d
 d d t
 |  d |  j  n  WYd d } ~ Xn Xd S)z#Save breakpoints when file is savedrNw=
breakpoint_error_displayedFTtitlez
IDLE Errorr   z$Unable to update breakpoint list:
%sparent)r5   rA   r   openr@   	readlinesr#   
startswithr!   update_breakpointsstrgetattrrootrn   tkMessageBox	showerrorr7   )r3   Zbreaksr   fplinesZnew_filer   errr   r   r   store_file_breaks   s.    	
	,z%PyShellEditorWindow.store_file_breaksc             C   s   |  j  j   |  j d  k r  d  S|  j j } | d  k r< d  St j j |  j  r t |  j d   } | j	   } Wd  QXxe | D]Z } | j
 | d  r t | t |  d d    } x | D] } |  j |  q Wq q Wn  d  S)Nrj   rl   r   )r7   r-   rA   r   r=   r>   isfiler@   rq   rr   rs   evallenra   )r3   r   rz   r{   r   Zbreakpoint_linenumbersZbreakpoint_linenumberr   r   r   r2     s     z'PyShellEditorWindow.restore_file_breaksc             C   s4   |  j  } | j d  } |  j |  } | |  _ d S)z3Retrieves all the breakpoints in the current windowrU   N)r7   Z
tag_rangesranges_to_linenumbersr5   )r3   r7   rangesZlinenumber_listr   r   r   rt     s    	z&PyShellEditorWindow.update_breakpointsc             C   s   g  } x t  d t |  d  D]f } t t | | j   } t t | | d j   } x' | | k  r | j |  | d 7} q^ Wq W| S)Nr      r   )ranger   rd   re   stringr\   )r3   r   r{   rZ   r   endr   r   r   r     s    z)PyShellEditorWindow.ranges_to_linenumbersc             C   s   |  j    t j |   d S)z7Extend base method - clear breaks when module is closedN)ri   r   _close)r3   r   r   r   r   -  s    
zPyShellEditorWindow._close)rD   rE   zrmenu_check_cut)rG   rH   rI   )rJ   rK   zrmenu_check_paste)NNN)rM   rN   N)rO   rP   N)r   
__module____qualname____doc__r6   Zrmenu_specsrB   ra   r9   r:   ri   r}   r2   rt   r   r   r   r   r   r   r1   v   s$   		*r1   c               @   s1   e  Z d  Z d Z e Z d Z d d d  Z d S)PyShellFileListz8Extend base class: IDLE supports a shell and breakpointsNc             C   sQ   |  j  r |  j  j j   n. t |   |  _  |  j  rJ |  j  j   sJ d  Sn  |  j  S)N)r]   topwakeupPyShellbegin)r3   rf   r   r   r   r<   <  s    		zPyShellFileList.open_shell)r   r   r   r   r1   r   r]   r<   r   r   r   r   r   3  s   r   c               @   sF   e  Z d  Z d Z d d   Z d d   Z d d   Z d d	   Z d
 S)ModifiedColorDelegatorz8Extend base class: colorizer for the shell window itselfc             C   s   t  j |   |  j   d  S)N)r   r6   LoadTagDefs)r3   r   r   r   r6   J  s    zModifiedColorDelegator.__init__c             C   s7   |  j  d d d  |  j d d d  t j |   d  S)NZTODOz1.0iomarkZSYNC)rh   rY   r   recolorize_main)r3   r   r   r   r   N  s    z&ModifiedColorDelegator.recolorize_mainc             C   s{   t  j |   t j   } |  j j i i d  d 6d  d 6d 6t j | d  d 6t j | d  d 6t j | d  d 6 d  S)NrT   rS   stdinstdoutstderrconsole)r   r   r   rV   tagdefsr-   rW   )r3   rX   r   r   r   r   S  s    z"ModifiedColorDelegator.LoadTagDefsc             C   s+   x$ |  j  D] } |  j | d d  q
 Wd  S)Nr   r   )r   rh   )r3   tagr   r   r   removecolors]  s    z#ModifiedColorDelegator.removecolorsN)r   r   r   r   r6   r   r   r   r   r   r   r   r   G  s
   
r   c               @   s4   e  Z d  Z d Z d d d  Z d d d  Z d S)ModifiedUndoDelegatorz;Extend base class: forbid insert/delete before the I/O markNc             C   s\   y- |  j  j | d d  r, |  j  j   d  SWn t k
 rA Yn Xt j |  | | |  d  S)N<r   )delegatecomparerc   TclErrorr   rb   )r3   rZ   charstagsr   r   r   rb   e  s    zModifiedUndoDelegator.insertc             C   sY   y- |  j  j | d d  r, |  j  j   d  SWn t k
 rA Yn Xt j |  | |  d  S)Nr   r   )r   r   rc   r   r   delete)r3   Zindex1Zindex2r   r   r   r   n  s    zModifiedUndoDelegator.delete)r   r   r   r   rb   r   r   r   r   r   r   b  s   	r   c               @   s   e  Z d  Z d d   Z d S)MyRPCClientc             C   s
   t   d S)z0Override the base class - just re-raise EOFErrorN)EOFError)r3   r   r   r   
handle_EOFz  s    zMyRPCClient.handle_EOFN)r   r   r   r   r   r   r   r   r   x  s   r   c               @   s  e  Z d  Z d d   Z d Z d Z d Z d d   Z d d   Z d d	   Z	 d
 d d d  Z
 d d   Z d d   Z d d   Z d d   Z d
 d d  Z d Z d d   Z d Z d d   Z d d   Z d d   Z d  d!   Z d" Z d# d$   Z d d% d&  Z d' d(   Z d) d*   Z d+ d,   Z d d- d.  Z d/ d0   Z d1 d2   Z d3 d4   Z  d5 d6   Z! d7 d8   Z" d9 d:   Z# d; d<   Z$ d= d>   Z% d S)?ModifiedInterpreterc             C   sf   | |  _  t j d j } t j |  d | d  |  _ d |  _ d  |  _ t	 |  _
 |  j j j |  _ d  S)N__main__localsF)	tkconsolesysmodules__dict__r   r6   save_warnings_filters
restartingsubprocess_arglistPORTportcompilecompilerflagsoriginal_compiler_flags)r3   r   r   r   r   r   r6     s    					zModifiedInterpreter.__init__Nc             C   s:   |  j  d  k r! |  j   |  _  n  t j |  j   |  _ d  S)N)r   build_subprocess_arglist
subprocessPopen
rpcsubproc)r3   r   r   r   spawn_subprocess  s    z$ModifiedInterpreter.spawn_subprocessc             C   s   d d   t  j D } t j d d d d d d d	 } t d
 k rS d | f } n d | f } t  j g | d | t |  j  g S)Nc             S   s   g  |  ] } d  |  q S)z-Wr   ).0r   r   r   r   
<listcomp>  s   	 z@ModifiedInterpreter.build_subprocess_arglist.<locals>.<listcomp>mainGeneralzdelete-exitfuncdefaultFtypeboolzidlelib.PyShellz&__import__('idlelib.run').run.main(%r)z__import__('run').main(%r)z-c)r   warnoptionsr   	GetOptionr   
executableru   r   )r3   rk   Z	del_exitfZcommandr   r   r   r     s    z,ModifiedInterpreter.build_subprocess_arglistc             C   s  t  |  j f } xX t d  D]< } t j |  y t |  |  _ PWq t k
 rW Yq Xq W|  j   d  S|  j j	 j
   d |  _ t d k r |  j j	 j t j t j d  n  |  j   |  j j	 j d  y |  j j   Wn# t j k
 r|  j   d  SYn X|  j j d |  j  |  j j d |  j j  |  j j d |  j j  |  j j d |  j j  |  j j d	 |  j j  |  j j d
 t  |  j j d |   |  j d d  |  j   |  j S)N   r   r   
   r   r   r   r   r;   r   r^   with_cwdT)HOSTr   r   timeZsleepr   rpccltr#   display_port_binding_errorlistening_sockZgetsocknamer   Z
setsockoptsocketZ
SOL_SOCKETZSO_REUSEADDRr   Z
settimeoutaccepttimeoutdisplay_no_subprocess_errorregisterr   r   r   r   r;   r   transfer_pathpoll_subprocess)r3   Zaddrir   r   r   start_subprocess  s>    	


	
z$ModifiedInterpreter.start_subprocessFrR   c             C   s  |  j  r |  j Sd |  _  |  j   } | rM y t j |  j  WqM YqM Xn  |  j j   |  j   |  j } | j } d | _ |  j	   y |  j j
   Wn# t j k
 r |  j   d  SYn X|  j d |  | j   | j j d d  d | r | n d } t | j  t |  d d	 d
 } | j d j | |   | j j d d  | j j d d  | sz| j   n  | rt j |  j  | j   n  |  j |  j j _ d |  _  |  j S)NTFr   r   zend-1cz	RESTART: ZShell   r   rl   z
{0} {1} {0}restartleft) r   r   getdebuggerr   Zclose_subprocess_debuggercloseterminate_subprocessr   	executingr   r   r   r   r   r   stop_readliner7   r   rd   widthr   r!   formatmark_setmark_gravity
showpromptZrestart_subprocess_debuggerload_breakpointsr   r   r   r   )r3   r   r   r`   r   Zwas_executingr   Zhalfbarr   r   r   restart_subprocess  sH    		
			

	
%	z&ModifiedInterpreter.restart_subprocessc             C   s   |  j  j d d f  i   d  S)NexecZinterrupt_the_server)r   Z
remotecall)r3   r   r   r   Z__request_interrupt  s    z'ModifiedInterpreter.__request_interruptc             C   s   t  j d |  j  j   d  S)Ntarget)	threadingZThread'_ModifiedInterpreter__request_interruptstart)r3   r   r   r   interrupt_subprocess  s    z(ModifiedInterpreter.interrupt_subprocessc             C   s   |  j  d  k	 r( |  j j j |  j   n  y |  j j j   Wn t k
 rP Yn Xy |  j j   Wn t k
 rv Yn X|  j   d |  j _	 d  |  _ d  S)NF)
_afteridr   r7   Zafter_cancelr   r   r   r"   r   r   )r3   r   r   r   kill_subprocess  s    
z#ModifiedInterpreter.kill_subprocessc             C   sX   y |  j  j   Wn t k
 r) d SYn+ Xy |  j  j   Wn t k
 rS d SYn Xd S)z"Make sure subprocess is terminatedN)r   killr#   wait)r3   r   r   r   r     s    	z(ModifiedInterpreter.terminate_subprocessc             C   sC   | r" d g } | j  t j  n	 t j } |  j d | f  d  S)NrR   zRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
)extendr   r>   
runcommand)r3   r   r>   r   r   r   r     s    		z!ModifiedInterpreter.transfer_pathc             C   s  |  j  } | d  k r d  Sy | j |  j d d } Wn; t t t f k
 rr |  j j r^ d  Sd  } |  j   Yn X| rp|  j j	   d  |  _ | \ } } |  j j
 } | d k r | d  k	 rGt t |  d | qGnl | d k r	|  j j d  rG|  j   qGn> | d k rGd } t | | d t j t | | d | n  y |  j j   Wqpt k
 rlYqpXn  |  j j s|  j j j |  j j |  j  |  _ n  d  S)	Nr   g?ZOKr   Z	EXCEPTIONz<<toggle-jit-stack-viewer>>ERRORz/PyShell.ModifiedInterpreter: Subprocess ERROR:
)r   Zpollresponse
active_seqr   r#   KeyboardInterruptr   closingr   resetoutputr   printreprgetvarremote_stack_viewerr   
__stderr__endexecutingr"   r7   afterpollintervalr   r   )r3   ZcltresponseZhowZwhatr   errmsgr   r   r   r   ,  s@    		z#ModifiedInterpreter.poll_subprocessc             C   s   | |  _  d  S)N)r_   )r3   r_   r   r   r   setdebuggerT  s    zModifiedInterpreter.setdebuggerc             C   s   |  j  S)N)r_   )r3   r   r   r   r   W  s    zModifiedInterpreter.getdebuggerc             C   s   |  j  j j d |  j  d S)a  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)r   r7   r   r   )r3   r   r   r   open_remote_stack_viewerZ  s    
z,ModifiedInterpreter.open_remote_stack_viewerc             C   s   d d l  m } |  j j d d d i   } | d  k rK |  j j j   d  S| j |  j |  } d d l m	 } m
 } t |  j j  } t j   } t j | d  d } | | d	 | d
 d }	 |	 j j d d d d  | |	 j d  |  }
 |
 j   d  S)Nr   )RemoteObjectBrowserr   Zstackviewerr;   )ScrolledCanvasTreeNodeZnormalrT   ZbgZhighlightthicknessexpandr   ZfillZboth)zflist)idlelibr  r   remotequeuer   rw   rc   ZStubObjectTreeItemZidlelib.TreeWidgetr  r  ZToplevelr   rV   rW   ZframeZpackZcanvasr  )r3   r  Zoiditemr  r  r   rX   rT   ZscZnoder   r   r   r   g  s    z'ModifiedInterpreter.remote_stack_viewerr   c             C   s#   |  j  |  } |  j | |  d S)z1Like runsource() but assumes complete exec sourceN)stuffsourceexecfile)r3   sourcer   r   r   r   
execsourcez  s    zModifiedInterpreter.execsourcec             C   s   | d k r3 t  j |   } | j   } Wd QXn  y t | | d  } WnX t t f k
 r |  j j   t d d |  j j	 t
 j |  |  |  j j   Yn X|  j |  d S)zExecute an existing fileNr   zB*** Error in script or command!
Traceback (most recent call last):r   )tokenizerq   readr   OverflowErrorSyntaxErrorr   r   r   r   r   showsyntaxerrorr   runcode)r3   r   r  rz   coder   r   r   r
    s    	zModifiedInterpreter.execfilec             C   s   |  j  |  } d |  _ t j d d  |  _ t j d d d t  z t j |  | |  SWd |  j d k	 r |  j t j d d  <d |  _ n  Xd S)zBExtend base class method: Stuff the source in the line cache firstr   Nactionerrorr   )	r	  Zmorer&   filtersr   filterwarningsSyntaxWarningr   	runsource)r3   r  r   r   r   r   r    s    	zModifiedInterpreter.runsourcec             C   sS   d |  j  } |  j  d |  _  | j d  } t |  d d | | f t j | <| S)z"Stuff source in the filename cachez<pyshell#%d>r   rm   r   )gidsplitr   r   r*   )r3   r  r   r{   r   r   r   r	    s
    #zModifiedInterpreter.stuffsourcec             C   s   |  j  d | f  d S)z>Prepend sys.path with file's directory if not already includeda(  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   )r3   r   r   r   r   prepend_syspath  s    z#ModifiedInterpreter.prepend_syspathc             C   s  |  j  } | j } | j d d d  t j   \ } } } t | d d  pU | pU d } t | d d  pm d } t | d	 d  p d
 }	 |	 d
 k r | d 7} n  | d k r d |	 d }
 n d | d |	 d f }
 | j | |
  | j   |  j d |  | j	   d S)zOverride Interactive Interpreter method: Use Colorizing

        Color the offending position instead of printing it and pointing at it
        with a caret.

        r   z1.0r   msgrR   z<no detail available>r   r   offsetr   ziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
N)
r   r7   rh   r   exc_inforv   Zcolorize_syntax_errorr   r!   r   )r3   r   r   r7   r   valuetbr  r   r  posr   r   r   r    s"    		
z#ModifiedInterpreter.showsyntaxerrorc             C   sJ   |  j  j   |  j   t j |   |  j  j d  rF |  j  j   n  d S)z1Extend base class method to reset output properlyz<<toggle-jit-stack-viewer>>N)r   r   checklinecacher   showtracebackr   open_stack_viewer)r3   r   r   r   r$    s
    
z!ModifiedInterpreter.showtracebackc             C   sX   t  j } xH t | j    D]4 } | d  d  | d d   d k r | | =q q Wd  S)Nr   z<>r)   )r   r*   r+   keys)r3   cr/   r   r   r   r#    s    	$z"ModifiedInterpreter.checklinecachec             C   sV   |  j  j r |  j   d S|  j rB |  j j d d | f i   n t | |  j  d S)z*Run the code without invoking the debuggerr   r   r  r   )r   r   display_executing_dialogr   r  r   r   )r3   r  r   r   r   r     s    
	zModifiedInterpreter.runcommandc             C   s  |  j  j r |  j j   n  |  j   |  j d k	 rW |  j t j d d  <d |  _ n  |  j } zNyw |  j  j	   | r |  j
 d k	 r |  j
 j d d | f i   |  _ n, | r | j | |  j  n t | |  j  Wn t k
 r4|  j  j s-t j d d d d d |  j  j r   q0|  j   n   Yny t rmt d	 d
 |  j  j |  j   |  j  j   n; |  j  j rd |  j  _ t d d
 |  j  j n
 |  j   Yn XWd t sy |  j  j   Wqt k
 rYqXn  Xd S)zOverride base class methodNr   r  zExit?zDo you want to exit altogether?r   yesrp   z IDLE internal error in runcode()r   Fr   )r   r   r^   r   r#  r   r&   r  r_   beginexecutingr   Z
asyncqueuer   Zrunr   r   
SystemExitr   rx   Zaskyesnor7   r$  use_subprocessr   r   r   canceledr"   )r3   r  r_   r   r   r   r    sP    
		
zModifiedInterpreter.runcodec             C   s   |  j  j j |  S)zOverride base class method)r   r   r!   )r3   r   r   r   r   r!   "  s    zModifiedInterpreter.writec             C   s    t  j d d d |  j j d  S)NzPort Binding ErroraA  IDLE 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   )rx   ry   r   r7   )r3   r   r   r   r   &  s    z.ModifiedInterpreter.display_port_binding_errorc             C   s    t  j d d d |  j j d  S)NzSubprocess Startup ErrorzIDLE's subprocess didn't make connection.  Either IDLE can't start a subprocess or personal firewall software is blocking the connection.rp   )rx   ry   r   r7   )r3   r   r   r   r   1  s    z/ModifiedInterpreter.display_no_subprocess_errorc             C   s    t  j d d d |  j j d  S)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.rp   )rx   ry   r   r7   )r3   r   r   r   r(  9  s    z,ModifiedInterpreter.display_executing_dialog)&r   r   r   r6   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r_   r   r   r  r   r  r  r
  r  r	  r  r  r$  r#  r   r  r!   r   r   r(  r   r   r   r   r     sF   
+-&1r   c                   s/  e  Z d  Z d e   d Z e Z e Z dV dW dX dY dZ d[ g Z	 d d l
 m Z d d d  Z d d   Z d Z d Z d Z d Z d Z d Z d d   Z d d   Z d d d  Z d d   Z d d d   Z d! d"   Z d# d$   Z d% d&   Z d' d(   Z d) d*   Z d+ d,   Z d- d.   Z d/ d0   Z  d1 Z! d2 d3   Z" d4 d5   Z# d6 d7   Z$ d8 d9   Z% d d: d;  Z& d< d=   Z' d> d?   Z( d@ dA   Z) dB dC   Z* dD dE   Z+ d dF dG  Z, d dH dI  Z- d dJ dK  Z. dL dM   Z/ dN dO   Z0 f  dP dQ  Z1   f dR dS   Z2   f dT dU   Z3   S)\r   zPython z Shellr   _Fileedit_Editr`   _Debugoptions_Optionswindows_Windowhelp_Helpr   )HistoryNc          	   C   s  t  r9 |  j } | d d d k r9 | j d d  q9 n  t |   |  _ | d  k r t   } t |  | j   t |  } n  t	 j
 |  | d  d   d |  _ d |  _ d |  _ |  j } | j d d  | j d	 |  j  | j d
 |  j  | j d |  j  | j d |  j  | j d |  j  | j d |  j  | j d |  j  t  r~| j d |  j  | j d |  j  n  t j |  _ t j |  _ t j |  _  d d l! m" } t# |  d | j$  |  _ t% |  d | j$  |  _ t% |  d | j$  |  _ t% |  d | j$  |  _& t  s?|  j t _ |  j t _ |  j t _ n  y d d  l' } | j( | _) Wn t j* t _   Yn X|  j+ |  j  |  _, d |  _- d  S)Nr   r   shellShe_llT   Zwrapcharz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>>z<<toggle-debugger>>z<<toggle-jit-stack-viewer>>z<<view-restart>>z<<restart-shell>>)	IOBindingr   r   r   r   2   )zshellr:  ).r,  
menu_specsrb   r   r^   Tkr	   withdrawr   r   r6   ZusetabsZindentwidthZcontext_use_ps1r7   Z	configurer8   enter_callbacklinefeed_callbackcancel_callbackeof_callbackr%  toggle_debuggertoggle_jit_stack_viewerview_restart_markrestart_shellr   r   save_stdoutr   save_stderrr   
save_stdinr  r=  PseudoInputFileencodingPseudoOutputFiler   pydocZ
plainpagerZpagerr   r8  historyr   )r3   r;   Zmsrw   r7   r=  rP  r   r   r   r6   W  s\    		

				zPyShell.__init__c             C   s   t  j d d  S)NZ
shell_onlyT)r   ZGetExtensions)r3   r   r   r   get_standard_extension_names  s    z$PyShell.get_standard_extension_namesFc             C   s
   | a  d  S)N)r    )r3   streamr   r   r   set_warning_stream  s    zPyShell.set_warning_streamc             C   s   t  S)N)r    )r3   r   r   r   get_warning_stream  s    zPyShell.get_warning_streamc             C   s`   |  j  r0 t j d d d |  j |  j   d S|  j j   } | rR |  j   n
 |  j   d  S)NzDon't debug nowz*You can only toggle the debugger when idlerp   rQ   )	r   rx   ry   r7   set_debugger_indicatorr^   r   close_debuggeropen_debugger)r3   rf   dbr   r   r   rF    s    		

zPyShell.toggle_debuggerc             C   s%   |  j  j   } |  j d |  d  S)Nz<<toggle-debugger>>)r^   r   Zsetvar)r3   rY  r   r   r   rV    s    zPyShell.set_debugger_indicatorc             C   s   d  S)Nr   )r3   rf   r   r   r   rG    s    zPyShell.toggle_jit_stack_viewerc             C   s   |  j  j   } | r |  j  j d   | j   |  j  j rQ t j |  j  j  n  |  j   |  j j	 d  d t
 _ |  j   n  |  j   d  S)Nz[DEBUG OFF]
z>>> )r^   r   r   r   r   r   Zclose_remote_debuggerr   r   r!   r   ps1r   rV  )r3   rY  r   r   r   rW    s    

	zPyShell.close_debuggerc             C   sq   |  j  j r' t j |  j  j |   } n t j |   } |  j  j |  | j   d t _ |  j	   |  j
   d  S)Nz[DEBUG ON]
>>> )r^   r   r   Zstart_remote_debuggerr   r   r   r   rZ  r   rV  )r3   Zdbg_guir   r   r   rX    s    
	
zPyShell.open_debuggerc             C   s   |  j    d |  _ d S)zHelper for ModifiedInterpreterr   N)r   r   )r3   r   r   r   r*    s    
zPyShell.beginexecutingc             C   s    d |  _  d |  _ |  j   d S)zHelper for ModifiedInterpreterr   N)r   r-  r   )r3   r   r   r   r     s    		zPyShell.endexecutingc             C   sf   |  j  r= t j d d d d d |  j } | d k r= d Sn  |  j   d |  _ d |  _ t j |   S)	zExtend EditorWindow.close()zKill?z7Your program is still running!
 Do you want to kill it?r   okrp   FZcancelT)	r   rx   Zaskokcancelr7   r   r-  r   r   r   )r3   r   r   r   r   r     s    	
		zPyShell.closec             C   s|   |  j    t r  |  j j   n  |  j t _ |  j t _ |  j	 t _
 d |  _ d |  _ d |  j _ d |  _ t j |   d S)zEExtend EditorWindow._close(), shut down debugger and execution serverN)rW  r,  r^   r   rJ  r   r   rK  r   rL  r   r   r;   r]   rQ  r   r   )r3   r   r   r   r     s    
			zPyShell._closec             C   s   d S)z8Override EditorWindow method: never remove the colorizerTr   )r3   r   r   r   r   ispythonsource  s    zPyShell.ispythonsourcec             C   s   |  j  S)N)shell_title)r3   r   r   r   short_title  s    zPyShell.short_titlez@Type "copyright", "credits" or "license()" for more information.c             C   s   |  j  j d d  |  j   t rO d } |  j j   } | sm |  j   d Sn d d d d } t j t	 _ |  j
 d	 t	 j t	 j |  j | f  |  j  j   |  j   d
 d  l } d  | _ d S)Nr   rb   rR   Fz==== No Subprocess ====

z9WARNING: Running IDLE without a Subprocess is deprecated
z;and will be removed in a later version. See Help/IDLE Help
zfor details.

zPython %s on %s
%s
%sr   T)r7   r   r   r,  r^   r   r   r   displayhookr   r!   versionplatform	COPYRIGHTZfocus_forcer   tkinterZ_default_root)r3   ZnosubZclientrc  r   r   r   r     s$    

	
	zPyShell.beginc             C   s'   |  j  s d  Sd |  _ |  j j   d  S)NT)reading_stop_readline_flagr   quit)r3   r   r   r   r     s    		zPyShell.stop_readlinec             C   s   |  j  } z d |  _  |  j j   Wd  | |  _  X|  j rF d |  _ d S|  j j d d  } t |  d k rv d } n  |  j   |  j r d |  _ t	 s t
  q n  |  j r d |  _ d } n  | S)Nr   FrR   r   zend-1cr   rm   )rd  r   mainloopre  r7   getr   r   r-  r,  r   	endoffile)r3   r.   r   r   r   r   readline"  s(    		
			
					zPyShell.readlinec             C   s   d S)NTr   )r3   r   r   r   isatty9  s    zPyShell.isattyc          
   C   s   y  |  j  j d d d  r d  SWn Yn X|  j p: |  j se |  j   |  j j d  |  j   d Sd |  _ d |  _	 |  j r |  j j
 r |  j j   r |  j j   q |  j j   n  |  j r |  j j   n  d S)Nz	sel.firstz!=zsel.lastzKeyboardInterrupt
rQ   r   r   )r7   r   r   rd  r   r^   r!   r   ri  r-  r   r   r   r   r   rf  )r3   rf   r   r   r   rD  <  s&    

			zPyShell.cancel_callbackc             C   s   |  j  r |  j r d  S|  j j d d d  oD |  j j d d d  sK d  S|  j  sk |  j   |  j   n d |  _ d |  _ |  j j	   d S)Nr   z==rb   zend-1cr   r   rQ   )
r   rd  r7   r   r   r   r-  ri  r   rf  )r3   rf   r   r   r   rE  R  s    	
		zPyShell.eof_callbackc             C   s@   |  j  r/ |  j j d d  |  j j d  n |  j |  d S)Nrb   rm   rQ   )rd  r7   rb   seenewline_and_indent_event)r3   rf   r   r   r   rC  a  s
    	zPyShell.linefeed_callbackc             C   s  |  j  r |  j r d  SyN |  j j d d  } | rd |  j j d d d  rd |  j | |  d Sn  Wn Yn X|  j j d d d  r|  j j d	 d  } | r |  j j d d | d
  r |  j |  j j | d | d
  |  d S|  j j d	 d  } | rL|  j j d d | d  rL|  j |  j j | d | d
  |  d S|  j j d d  } | r|  j j | d d d  r|  j |  j j | d
 d  |  n |  j |  j j d d  |  d S|  j j d d d  r|  j j d d  n  |  j j d d  } | r8| j	   r8|  j j
 d d  n  |  j j d d d  ra|  j |  d S|  j j d d  |  j r|  j j d d  |  j j d  n |  j |  |  j j d	 d d  |  j j   |  j r|  j j   n
 |  j   d S)Nz	sel.firstzsel.lastz<=r   rQ   rb   r   ziomark linestartr   r   r   zinsert lineendz>=r   zinsert linestartzend-1czend-1c linestartrm   )r   rd  r7   rh  r   recallZtag_prevrangeZtag_nextranger   r   r   rm  rb   rl  rY   Zupdate_idletasksr   rf  runit)r3   rf   selprevnextindicesr   r   r   r   rB  j  sX    "'"'&		
zPyShell.enter_callbackc             C   s  t  j d d |  } t  j d d |  } | j d  } |  j j   zL|  j j d d d  |  j j d d	  |  j j d
 d  } | j   j	 d  r |  j
 |  |  j j d
 d  } n  |  j j d | d j    t |  d k rt  j d | d  j d  } t  j d |  j d  } xd | d d   D]O } | j |  rm| | t |  d   } n  |  j j d d | j    q;Wn  Wd  |  j j d  |  j j   Xd  S)Nz^\s*\nrR   z\n\s*$rm   rp  z1.0r   rb   zend-1czinsert linestart:r   r   z	^([ \t]*))resubr  r7   Zundo_block_startrh   r   rh  rstripendswithrm  rb   r   r   searchgrouprs   rl  Zundo_block_stop)r3   r   rf   r{   prefixZorig_base_indentZnew_base_indentr   r   r   r   rn    s*    (zPyShell.recallc             C   s   |  j  j d d  } t |  } x. | d k rQ | | d d k rQ | d } q$ W| d k r | | d d k r | d } n  x. | d k r | | d d k r | d } q W| d  |  } |  j j |  d  S)Nr   zend-1cr   r   z 	rm   )r7   rh  r   r^   r  )r3   r   r   r   r   r   ro    s    # #zPyShell.runitc             C   ss   |  j  j r |  j  j   Sy t j Wn% t j d d d |  j d  SYn Xd d l m	 } | |  j
 |  j  d  S)NzNo stack tracez@There is no stack trace yet.
(sys.last_traceback is not defined)rp   r   )StackBrowser)r^   r   r   r   last_tracebackrx   ry   r7   Zidlelib.StackViewerr|  rw   r;   )r3   rf   r|  r   r   r   r%    s    	
	zPyShell.open_stack_viewerc             C   s$   |  j  j d  |  j  j d  d  S)Nr   r   )r7   rl  )r3   rf   r   r   r   rH    s    zPyShell.view_restart_markc             C   s   |  j  j d d  d S)z&Callback for Run/Restart Shell Cntl-F6r   TN)r^   r   )r3   rf   r   r   r   rI    s    zPyShell.restart_shellc          	   C   sl   |  j    y t t j  } Wn d } Yn X|  j j |  |  j j d d  |  j   |  j	 j
   d  S)NrR   rb   zend-1c)r   ru   r   rZ  r   r!   r7   r   set_line_and_columnrA   Z
reset_undo)r3   r   r   r   r   r     s    

zPyShell.showpromptc             C   s   |  j  j d d  } |  j r1 |  j j |  n  |  j  j d  d k r_ |  j  j d d  n  |  j  j d d  |  j   d  S)Nr   zend-1czend-2crm   )r7   rh  rQ  Zstorerb   r   r~  )r3   r  r   r   r   r     s    	zPyShell.resetoutputc             C   s   t  | t  ry t |  ry t |  d k ry x* t |  D] \ } } | d k r: Pq: q: Wt d | | | d d   n  yB |  j j d d  t j	 |  | | d  } |  j j d d  Wn   Yn X|  j
 r d |  _
 t s t  q n  | S)	Nu   ￿zUCS-2r   z%Non-BMP character not supported in Tkr   rightr   r   )
isinstanceru   r   max	enumerateUnicodeEncodeErrorr7   r   r   r!   r-  r,  r   )r3   r   r   r   r<  countr   r   r   r!     s"    -		zPyShell.writec                sF   y  |  j  j d d d  r d SWn t k
 r8 d SYn Xt   j   S)Nz	sel.firstr   r   disabled)r7   r   r   superrF   )r3   )	__class__r   r   rF     s    	zPyShell.rmenu_check_cutc                s)   |  j  j d d d  r d St   j   S)Nrb   r   r   r  )r7   r   r  rL   )r3   )r  r   r   rL     s    zPyShell.rmenu_check_paste)zfiler.  )r/  r0  )zdebugr1  )r2  r3  )r4  r5  )zhelpr7  )4r   r   r   r   r]  r   r   r   r   r?  Zidlelib.IdleHistoryr8  r6   rR  rd  r   r-  ri  r   re  rT  rU  rF  rV  rG  rW  rX  r*  r   r   r   r\  r^  rb  r   r   rj  rk  rD  rE  rC  rB  rn  ro  r%  rH  rI  r   r   r!   rF   rL   r   r   )r  r   r   A  sd   	:	?	r   c               @   sO   e  Z d  Z d d d  Z e d d    Z e d d    Z d d	   Z d S)

PseudoFileNc             C   s   | |  _  | |  _ | |  _ d  S)N)r9  r   	_encoding)r3   r9  r   rN  r   r   r   r6   "  s    		zPseudoFile.__init__c             C   s   |  j  S)N)r  )r3   r   r   r   rN  '  s    zPseudoFile.encodingc             C   s   d |  j  S)Nz<%s>)r   )r3   r   r   r   name+  s    zPseudoFile.namec             C   s   d S)NTr   )r3   r   r   r   rk  /  s    zPseudoFile.isatty)r   r   r   r6   propertyrN  r  rk  r   r   r   r   r     s   r  c               @   s(   e  Z d  Z d d   Z d d   Z d S)rO  c             C   s   d S)NTr   )r3   r   r   r   writable5  s    zPseudoOutputFile.writablec             C   s}   |  j  r t d   n  t |  t k	 rg t | t  sU t d t |  j   n  t j |  } n  |  j j	 | |  j
  S)Nzwrite to closed filezmust be str, not )closedr[   r   ru   r  	TypeErrorr   __str__r9  r!   r   )r3   r   r   r   r   r!   8  s    	zPseudoOutputFile.writeN)r   r   r   r  r!   r   r   r   r   rO  3  s   rO  c               @   sU   e  Z d  Z d d d  Z d d   Z d d d  Z d d	 d
  Z d d   Z d S)rM  Nc             C   s#   t  j |  | | |  d |  _ d  S)NrR   )r  r6   _line_buffer)r3   r9  r   rN  r   r   r   r6   E  s    zPseudoInputFile.__init__c             C   s   d S)NTr   )r3   r   r   r   readableI  s    zPseudoInputFile.readabler   c             C   s  |  j  r t d   n  | d  k r- d } n+ t | t  sX t d t |  j   n  |  j } d |  _ | d k  r x |  j j	   } | s Pn  | | 7} qy Wn_ x9 t
 |  | k  r |  j j	   } | s Pn  | | 7} q W| | d   |  _ | d  |  } | S)Nzread from closed filer   zmust be int, not rR   r   r)   )r  r[   r  rd   r  r   r   r  r9  rj  r   )r3   sizeresultr   r   r   r   r  L  s,    				  zPseudoInputFile.readc             C   s   |  j  r t d   n  | d  k r- d } n+ t | t  sX t d t |  j   n  |  j pm |  j j	   } | d k  r t
 |  } n  | j d d |  } | d k r | d } n  | | d   |  _ | d  |  S)Nzread from closed filer   zmust be int, not r   rm   r)   )r  r[   r  rd   r  r   r   r  r9  rj  r   find)r3   r  r   Zeolr   r   r   rj  c  s    		zPseudoInputFile.readlinec             C   s   |  j  j   d  S)N)r9  r   )r3   r   r   r   r   s  s    zPseudoInputFile.closer)   r)   )r   r   r   r6   r  r  rj  r   r   r   r   r   rM  C  s
   rM  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  t  d  d a d }  d } d } d  } d  } d } y) t j t j d d   d  \ } } WnR t j k
 r } z/ t d | t f d t j t j	 d  WYd  d  } ~ Xn XxE| D]=\ }	 }
 |	 d k r |
 } d }  n  |	 d	 k r d } d }  n  |	 d
 k rd } n  |	 d k r9t j
 j t  t j	   n  |	 d k rNd }  n  |	 d k rvt d d t j d a n  |	 d k r|
 } t j j |  rn t d |  t j	   d }  n  |	 d k rd } d }  n  |	 d k r |
 t _ d }  q q W| r(| d d k r(t j j   } d }  n  x= t t t j   D]& } t j j t j |  t j | <q>W| r| d d k rd g | d d   t _ n | rd g | t _ n | r| g | t _ n | rTd } g  } x' | D] } | j t j j |   qWxy | D]= } t j j |  } | t j k rt j j d |  qqWn1 t j   } | t j k rt j j d |  n  t j d d d d d } | p| } |  p| }  t d d  a t j j t j j t  d   t    d k r t j j  d  } t j! d  |  nf t" d! k rt" d" k r>d# n d$      f d% d&   d3 D } d* d&   | D } t j# d |  n  t$ t  t j%   t& t  a' t( j) t t'  t( j*   rt j+ d+ d,  t j+ d+ d-  t j+ d+ d.  n  | r`| p| s`x= | d  d   D]+ } t' j, |  d  k r| j- |  qqW| s]t' j.   q]q`n  |  rt' j/   } | s|d  St( j*   rt' j0 r| j1 j2   qn	 t' j3 } | r| j4   n  | rt j5 j6 d/  pt j5 j6 d0  } | rt j j |  r| j7 j8 |  qn  | s$| r| j7 j9 d1 t j f  | rW| j7 j: |  q| r| j7 j; |  | j7 j8 |  qn5 | rt( j< t  } | r| j7 j9 d2 |  qn  x t' j= rt j>   qWt j?   t  d  d  S)4NTFr   zc:deihnr:st:zError: %s
%sr   r   z-cz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-tr   -rR   r   r   zeditor-on-startupr   r   Z	classNameZIdleZIconsZWindowszidle.icor   g      !@g333333!@z.pngz.gifc                s/   g  |  ]% } t  j j  d  |   f   q S)z	idle_%d%s)r=   r>   r?   )r   r  )exticondirr   r   r     s   	zmain.<locals>.<listcomp>       0   c             S   s   g  |  ] } t  d  |   q S)r   )Z
PhotoImage)r   iconfiler   r   r   r     s   	 ZTextz<B2>z<B2-Motion>z<<PasteSelection>>ZIDLESTARTUPZPYTHONSTARTUPzbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
zprint('%s'))r  r  r  )@r(   r,  getoptr   argvr  r   	usage_msgr   exitr   r!   r=   r>   r~   r   r]  r   r  r   r   abspathr\   dirnamerb   getcwdr   r   r@  rw   r?   __file__r   Zwm_iconbitmapZ	TkVersionZwm_iconphotor	   rA  r   r;   r   ZsetupAppZisAquaTkZunbind_classrq   rg   newr<   dictr   lowerr]   rX  environrh  r^   r
  r   r  r  ZtkVersionWarningZinversedictrg  Zdestroy)Zenable_shellZenable_editr`   cmdZscriptZstartupZoptsrC   r  oar   Zpathxr   dirZ
edit_startr  Z	iconfilesZiconsr9  Ztkversionwarningr   )r  r  r   r     s    
) 					
	
				$!


		
r   r   F)Er  r=   Zos.pathru  r   r   r   r   r   r  rA   r   r  r   ra  r   r   rc  ImportErrorr   r   r  Ztkinter.messageboxZ
messageboxrx   Zidlelib.EditorWindowr   r	   Zidlelib.FileListr
   Zidlelib.ColorDelegatorr   Zidlelib.UndoDelegatorr   Zidlelib.OutputWindowr   Zidlelib.configHandlerr   r  r   r   r   r   r   r   r    r&   r   r$   r%   r(   
checkcacher0   r1   r   r   r   Z	RPCClientr   r   r   
TextIOBaser  rO  rM  r  r   r   r   r   r   r   r   <module>   sx   	
	
	  h
