
g[\                 @   s~  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 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  d l( m- Z- d Z. d  Z/ e j a0 d  d l1 Z1 d d d  Z2 d d d d  Z3 d a4 d d   Z5 e5 d  d e j6 d d  Z7 e7 e _6 Gd d   d e  Z8 Gd d    d  e  Z9 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? Gd+ d,   d, e j@  ZA Gd- d.   d. eA  ZB Gd/ d0   d0 eA  ZC d1 ZD d2 d3   ZE eF d4 k rpe jG d4 e jG d* <eE   n  e5 d5  d S)6    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)idlever)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   %/usr/lib/python3.4/idlelib/PyShell.pyidle_formatwarning3   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_warningsS   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_checkcacheb   s    	$
r1   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   r3   color_breakpoint_text)r4   argsr5   r   r   r   r7   |   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   s[   | r0 t  j d d d  } t  j | d  } n i d d 6d d 6} |  j j d |  d	 S)
z,Turn colorizing of breakpoint text on or offmainThemenamebreak 
foreground
backgroundBREAKN)r   	GetOptionGetHighlightr8   Z
tag_config)r4   ZcolorthemeZcfgr   r   r   rC      s
    z)PyShellEditorWindow.color_breakpoint_textc             C   s   |  j  } |  j j } | j d d | d | d  y |  j j |  } Wn" t k
 rn |  j j |  Yn Xy& |  j j	 j
 j } | j | |  Wn Yn Xd  S)NrY   z%d.0r   )r8   rB   r   tag_addr6   index
ValueErrorappendr<   pyshellinterpdebuggerr:   )r4   r   r8   r   i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)r8   rB   r   bellintfloatr^   rf   )r4   eventr8   r   r   r   r   r   r:      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)Nrg   rY   zinsert linestartzinsert lineend +1char)r8   rB   r   rh   ri   rj   r^   r6   remove
tag_remover<   ra   rb   rc   r;   )r4   rk   r8   r   r   re   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)NrY   z1.0)r6   r8   rB   r   rh   rm   ZENDr<   ra   rb   rc   clear_file_breaks)r4   r8   r   re   r   r   r   rn      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)r6   rB   r   openrA   	readlinesr$   
startswithr"   update_breakpointsstrgetattrrootrs   tkMessageBox	showerrorr8   )r4   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)Nro   rq   r   )r8   r.   rB   r   r>   r?   isfilerA   rv   rw   rx   evallenrf   )r4   r   r   r   r   Zbreakpoint_linenumbersZbreakpoint_linenumberr   r   r   r3   	  s     z'PyShellEditorWindow.restore_file_breaksc             C   s4   |  j  } | j d  } |  j |  } | |  _ d S)z3Retrieves all the breakpoints in the current windowrY   N)r8   Z
tag_rangesranges_to_linenumbersr6   )r4   r8   rangesZlinenumber_listr   r   r   ry     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   ri   rj   stringr`   )r4   r   r   r^   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)rn   r   _close)r4   r   r   r   r   2  s    
zPyShellEditorWindow._close)rE   rF   zrmenu_check_cut)rH   rI   rJ   )rK   rL   zrmenu_check_paste)NNN)rN   rO   N)rP   rQ   N)r   
__module____qualname____doc__r7   Zrmenu_specsrC   rf   r:   r;   rn   r   r3   ry   r   r   r   r   r   r   r2   y   s$   			/r2   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)ra   topwakeupPyShellbegin)r4   rk   r   r   r   r=   A  s    		zPyShellFileList.open_shell)r   r   r   r   r2   r   ra   r=   r   r   r   r   r   8  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   r7   LoadTagDefs)r4   r   r   r   r7   O  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)rm   r]   r   recolorize_main)r4   r   r   r   r   S  s    z&ModifiedColorDelegator.recolorize_mainc             C   s   t  j |   t j d d d  } |  j j i i d  d 6d  d 6d 6t j | d  d 6t j | d  d 6t j | d	  d	 6 d  S)
NrR   rS   rT   rX   rW   stdinstdoutstderrconsole)r   r   r   rZ   tagdefsr.   r[   )r4   r\   r   r   r   r   X  s    z"ModifiedColorDelegator.LoadTagDefsc             C   s+   x$ |  j  D] } |  j | d d  q
 Wd  S)Nr   r   )r   rm   )r4   tagr   r   r   removecolorsb  s    z#ModifiedColorDelegator.removecolorsN)r   r   r   r   r7   r   r   r   r   r   r   r   r   L  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comparerh   TclErrorr   rg   )r4   r^   charstagsr   r   r   rg   j  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   rh   r   r   delete)r4   Zindex1Zindex2r   r   r   r   s  s    zModifiedUndoDelegator.delete)r   r   r   r   rg   r   r   r   r   r   r   g  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)r4   r   r   r   
handle_EOF  s    zMyRPCClient.handle_EOFN)r   r   r   r   r   r   r   r   r   }  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  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. d/   Z d0 d1   Z d2 d3   Z  d4 d5   Z! d6 d7   Z" d8 d9   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   r7   save_warnings_filters
restartingsubprocess_arglistPORTportcompilecompilerflagsoriginal_compiler_flags)r4   r   r   r   r   r   r7     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)r4   r   r   r   spawn_subprocess  s    z$ModifiedInterpreter.spawn_subprocessc             C   s   |  j  d k s t d   d d   t j D } t j d d d d d	 d
 d } t d k rn d | f } n d | f } t j g | d | t |  j   g S)Nr   z/Socket should have been assigned a port number.c             S   s   g  |  ] } d  |  q S)z-Wr   ).0r   r   r   r   
<listcomp>  s   	 z@ModifiedInterpreter.build_subprocess_arglist.<locals>.<listcomp>rR   Generalzdelete-exitfuncdefaultFtypeboolzidlelib.PyShellz&__import__('idlelib.run').run.main(%r)z__import__('run').main(%r)z-c)	r   AssertionErrorr   warnoptionsr   rZ   r   
executablerz   )r4   rp   Z	del_exitfZcommandr   r   r   r     s    	z,ModifiedInterpreter.build_subprocess_arglistc             C   s  t  |  j f } xk t d  D]O } t j |  y t |  |  _ PWq t k
 rj } z WYd  d  } ~ Xq 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   Wn6 t j k
 r*} z |  j   d  SWYd  d  } ~ Xn 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   rb   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)r4   Zaddrrd   r   r   r   r   start_subprocess  s>    



z$ModifiedInterpreter.start_subprocessFc             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
   Wn6 t j k
 r } z |  j   d  SWYd  d  } ~ Xn X|  j d |  | j   | j j d d  | r | j d  | j   n  t | j  d d d	 } | j | d
 |  | j j d d  | j j d d  | j   | rt j |  j  } | j   n  |  j |  j j _ d |  _  |  j S)NTFr   r   zend-1crr      r   rq   z	 RESTART restartleft)r   r   getdebuggerr   Zclose_subprocess_debuggercloseterminate_subprocessr   	executingr   r   r   r   r   r   stop_readliner8   r   r"   
showpromptri   widthmark_setmark_gravityZrestart_subprocess_debuggerload_breakpointsr   r   r   r   )r4   r   re   r   Zwas_executingr   ZhalfbarZguir   r   r   restart_subprocess  sJ    		
			



	z&ModifiedInterpreter.restart_subprocessc             C   s   |  j  j d d f  i   d  S)NexecZinterrupt_the_server)r   Z
remotecall)r4   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)r4   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   r8   Zafter_cancelr   r   r   r#   r   r   )r4   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)r4   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)NrV   zRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
)extendr   r?   
runcommand)r4   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#   r8   afterpollintervalr   r   )r4   ZcltresponseZhowZwhatr   errmsgr   r   r   r   2  s@    		z#ModifiedInterpreter.poll_subprocessc             C   s   | |  _  d  S)N)rc   )r4   rc   r   r   r   setdebuggerZ  s    zModifiedInterpreter.setdebuggerc             C   s   |  j  S)N)rc   )r4   r   r   r   r   ]  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   r8   r   r   )r4   r   r   r   open_remote_stack_viewer`  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 d d d	  } t j | d
  d } | | d | d d }	 |	 j j d d d d  | |	 j d  |  }
 |
 j   d  S)Nr   )RemoteObjectBrowserr   Zstackviewerr<   )ScrolledCanvasTreeNoderR   rS   rT   ZnormalrX   ZbgZhighlightthicknessexpandr   ZfillZboth)zflist)idlelibr  r   remotequeuer   r|   rh   ZStubObjectTreeItemZidlelib.TreeWidgetr  r  ZToplevelr   rZ   r[   ZframeZpackZcanvasr  )r4   r  Zoiditemr  r  r   r\   rX   ZscZnoder   r   r   r   m  s    z'ModifiedInterpreter.remote_stack_viewerr   c             C   s#   |  j  |  } |  j | |  d S)z1Like runsource() but assumes complete exec sourceN)stuffsourceexecfile)r4   sourcer   r   r   r   
execsource  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   )tokenizerv   readr   OverflowErrorSyntaxErrorr   r   r   r   r   showsyntaxerrorr   runcode)r4   r   r  r   coder   r   r   r    s    	zModifiedInterpreter.execfilec             C   s   |  j  |  } d |  _ t j d d  |  _ t j d d d t  t | t  sY 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  morer'   filtersr   filterwarningsSyntaxWarning
isinstancerz   r   r   	runsource)r4   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   rr   r   )gidsplitr   r   r+   )r4   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   )r4   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   msgrV   z<no detail available>r   r   offsetr   ziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
N)
r   r8   rm   r   exc_infor{   Zcolorize_syntax_errorr   r"   r   )r4   r   r   r8   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)r4   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)r4   cr0   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   )r4   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   Zyesmasterz IDLE internal error in runcode()r   Fr   )r   r   rb   r   r'  r   r'   r  rc   beginexecutingr   Z
asyncqueuer   Zrunr   r   
SystemExitr   r}   Zaskyesnor8   r(  use_subprocessr   r   r   canceledr#   )r4   r  rc   r   r   r   r    sP    
		
zModifiedInterpreter.runcodec             C   s   |  j  j j |  S)zOverride base class method)r   r   r"   )r4   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.r-  )r}   r~   r   r8   )r4   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.r-  )r}   r~   r   r8   )r4   r   r   r   r   7  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.r-  )r}   r~   r   r8   )r4   r   r   r   r,  ?  s    z,ModifiedInterpreter.display_executing_dialog)&r   r   r   r7   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rc   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                   sK  e  Z d  Z d e   d Z e Z e Z dY dZ d[ d\ d] d^ g Z	 e
 j d k r] d_ e	 d` <n  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  d0 d1   Z! d2 d3   Z" d4 Z# d5 d6   Z$ d7 d8   Z% d9 d:   Z& d; d<   Z' d d= d>  Z( d? d@   Z) dA dB   Z* dC dD   Z+ dE dF   Z, dG dH   Z- d dI dJ  Z. d dK dL  Z/ d dM dN  Z0 dO dP   Z1 dQ dR   Z2 f  dS dT  Z3   f dU dV   Z4   f dW dX   Z5   S)ar   zPython z Shellr   _Fileedit_Editre   _Debugoptions_Optionswindows_Windowshelp_Helpdarwin_Windowr   r   )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@  ).r0  
menu_specsrg   r   rb   Tkr	   withdrawr   r   r7   ZusetabsZindentwidthZcontext_use_ps1r8   Z	configurer9   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  rC  PseudoInputFileencodingPseudoOutputFiler   pydocZ
plainpagerZpagerr   r>  historyr   )r4   r<   Zmsr|   r8   rC  rV  r   r   r   r7   `  s\    		

				zPyShell.__init__c             C   s   t  j d d  S)NZ
shell_onlyT)r   ZGetExtensions)r4   r   r   r   get_standard_extension_names  s    z$PyShell.get_standard_extension_namesFc             C   s
   | a  d  S)N)r!   )r4   streamr   r   r   set_warning_stream  s    zPyShell.set_warning_streamc             C   s   t  S)N)r!   )r4   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 idler-  rU   )	r   r}   r~   r8   set_debugger_indicatorrb   r   close_debuggeropen_debugger)r4   rk   dbr   r   r   rL    s    		

zPyShell.toggle_debuggerc             C   s%   |  j  j   } |  j d |  d  S)Nz<<toggle-debugger>>)rb   r   Zsetvar)r4   r_  r   r   r   r\    s    zPyShell.set_debugger_indicatorc             C   s   d  S)Nr   )r4   rk   r   r   r   rM    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>>> )rb   r   r  r   r   r   Zclose_remote_debuggerr   r   r"   r   ps1r   r\  )r4   r_  r   r   r   r]    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]
>>> )rb   r   r   Zstart_remote_debuggerr   r  r   r   r`  r   r\  )r4   Zdbg_guir   r   r   r^    s    
	
zPyShell.open_debuggerc             C   s   |  j    d |  _ d S)zHelper for ModifiedInterpreterr   N)r   r   )r4   r   r   r   r.    s    
zPyShell.beginexecutingc             C   s    d |  _  d |  _ |  j   d S)zHelper for ModifiedInterpreterr   N)r   r1  r   )r4   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?z6The program is still running!
 Do you want to kill it?r   okru   FZcancelT)	r   r}   Zaskokcancelr8   r   r1  r   r   r   )r4   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)r]  r0  rb   r   rP  r   r   rQ  r   rR  r   r   r<   ra   rW  r   r   )r4   r   r   r   r     s    
			zPyShell._closec             C   s   d S)z8Override EditorWindow method: never remove the colorizerTr   )r4   r   r   r   r   ispythonsource  s    zPyShell.ispythonsourcec             C   s   |  j  S)N)shell_title)r4   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   d
 d  l } d  | _ d S)Nr   rg   rV   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)r8   r   r   r0  rb   r   r   r   displayhookr   r"   versionplatform	COPYRIGHTr   tkinterZ_default_root)r4   ZnosubZclientri  r   r   r   r     s"    

	
	zPyShell.beginc             C   s'   |  j  s d  Sd |  _ |  j j   d  S)NT)reading_stop_readline_flagr   quit)r4   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   FrV   r   zend-1cr   rr   )rj  r   mainlooprk  r8   getr   r   r1  r0  r   	endoffile)r4   r/   r   r   r   r   readline*  s(    		
			
					zPyShell.readlinec             C   s   d S)NTr   )r4   r   r   r   isattyA  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
rU   r   r   )r8   r   r   rj  r   rb   r"   r   ro  r1  r   r   r   r   r   rl  )r4   rk   r   r   r   rJ  D  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==rg   zend-1cr   r   rU   )
r   rj  r8   r   r   r   r1  ro  r   rl  )r4   rk   r   r   r   rK  Z  s    	
		zPyShell.eof_callbackc             C   s@   |  j  r/ |  j j d d  |  j j d  n |  j |  d S)Nrg   rr   rU   )rj  r8   rg   seenewline_and_indent_event)r4   rk   r   r   r   rI  i  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   rU   rg   r   ziomark linestartr   r   r   zinsert lineendz>=r   zinsert linestartzend-1czend-1c linestartrr   )r   rj  r8   rn  r   recallZtag_prevrangeZtag_nextranger   r   r   rs  rg   rr  r]   Zupdate_idletasksr   rl  runit)r4   rk   selprevnextindicesr   r   r   r   rH  r  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*\nrV   z\n\s*$rr   rv  z1.0r   rg   zend-1czinsert linestart:r   r   z	^([ \t]*))resubr  r8   Zundo_block_startrm   r   rn  rstripendswithrs  rg   r   r   searchgrouprx   rr  Zundo_block_stop)r4   r   rk   r   prefixZorig_base_indentZnew_base_indentr   r   r   r   rt    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 	rr   )r8   rn  r   rb   r  )r4   r   rd   r  r   r   r   ru    s    # #zPyShell.runitc             C   su   |  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)r-  r   )StackBrowser)rb   r   r   r   last_tracebackr}   r~   r8   Zidlelib.StackViewerr  r|   r<   )r4   rk   r  Zsvr   r   r   r)    s    	
	zPyShell.open_stack_viewerc             C   s$   |  j  j d  |  j  j d  d  S)Nr   r   )r8   rr  )r4   rk   r   r   r   rN    s    zPyShell.view_restart_markc             C   s   |  j  j d d  d S)z&Callback for Run/Restart Shell Cntl-F6r   TN)rb   r   )r4   rk   r   r   r   rO    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)NrV   rg   zend-1c)r   rz   r   r`  r   r"   r8   r   set_line_and_columnrB   Z
reset_undo)r4   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-2crr   )r8   rn  rW  Zstorerg   r   r  )r4   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   )r  rz   r   max	enumerateUnicodeEncodeErrorr8   r   r   r"   r1  r0  r   )r4   r   r   r   rB  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)r8   r   r   superrG   )r4   )	__class__r   r   rG     s    	zPyShell.rmenu_check_cutc                s)   |  j  j d d d  r d St   j   S)Nrg   r   r   r  )r8   r   r  rM   )r4   )r  r   r   rM   #  s    zPyShell.rmenu_check_paste)zfiler2  )r3  r4  )zdebugr5  )r6  r7  )r8  r9  )zhelpr;  )r8  r=  )6r   r   r   r   rc  r   r   r   r   rE  r   rg  Zidlelib.IdleHistoryr>  r7   rX  rj  r   r1  ro  r   rk  rZ  r[  rL  r\  rM  r]  r^  r.  r   r   r   rb  rd  rh  r   r   rp  rq  rJ  rK  rI  rH  rt  ru  r)  rN  rO  r   r   r"   rG   rM   r   r   )r  r   r   G  sh   	:	?	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)r?  r   	_encoding)r4   r?  r   rT  r   r   r   r7   *  s    		zPseudoFile.__init__c             C   s   |  j  S)N)r  )r4   r   r   r   rT  /  s    zPseudoFile.encodingc             C   s   d |  j  S)Nz<%s>)r   )r4   r   r   r   rT   3  s    zPseudoFile.namec             C   s   d S)NTr   )r4   r   r   r   rq  7  s    zPseudoFile.isatty)r   r   r   r7   propertyrT  rT   rq  r   r   r   r   r  (  s   r  c               @   s(   e  Z d  Z d d   Z d d   Z d S)rU  c             C   s   d S)NTr   )r4   r   r   r   writable=  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   rz   r  	TypeErrorr   __str__r?  r"   r   )r4   r   r   r   r   r"   @  s    	zPseudoOutputFile.writeN)r   r   r   r  r"   r   r   r   r   rU  ;  s   rU  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)rS  Nc             C   s#   t  j |  | | |  d |  _ d  S)NrV   )r  r7   _line_buffer)r4   r?  r   rT  r   r   r   r7   M  s    zPseudoInputFile.__init__c             C   s   d S)NTr   )r4   r   r   r   readableQ  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 n_ x9 t
 |  | k  r |  j j	   } | s Pn  | | 7} q W| | d   |  _ | d  |  } | S)Nzread from closed filer   zmust be int, not rV   r   r*   )r  r_   r  ri   r  r   r   r  r?  rp  r   )r4   sizeresultr   r   r   r   r  T  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   rr   r*   )r  r_   r  ri   r  r   r   r  r?  rp  r   find)r4   r  r   Zeolr   r   r   rp  k  s    		zPseudoInputFile.readlinec             C   s   |  j  j   d  S)N)r?  r   )r4   r   r   r   r   {  s    zPseudoInputFile.closer*   r*   )r   r   r   r7   r  r  rp  r   r   r   r   r   rS  K  s
   rS  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&   d/ D } d* d&   | D } t j# d |  n  t$ t  t j%   t& t  a' t( j) t t'  | r!| p| s!x= | d  d   D]+ } t' j* |  d  k r| j+ |  qqW| st' j,   qq!n  |  ret' j-   } | s=d  St( j.   rnt' j/ rn| j0 j1   qnn	 t' j2 } | r| j3   n  | rt j4 j5 d+  pt j4 j5 d,  } | rt j j |  r| j6 j7 |  qn  | s| rD| j6 j8 d- t j f  | r| j6 j9 |  qy| ry| j6 j: |  | j6 j7 |  qyn5 | ryt( j; t  } | ry| j6 j8 d. |  qyn  x t' j< rt j=   q|Wt j>   t  d  d  S)0NTFr   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   -rV   rR   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>r       0   c             S   s   g  |  ] } t  d  |   q S)r   )Z
PhotoImage)r   iconfiler   r   r   r     s   	 ZIDLESTARTUPZPYTHONSTARTUPzbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
zprint('%s'))r   r  r  )?r)   r0  getoptr   argvr  r   	usage_msgr   exitr   r"   r>   r?   r   r   rc  r   r  r   r   abspathr`   dirnamerg   getcwdr   rZ   rF  r|   r@   __file__r   Zwm_iconbitmapZ	TkVersionZwm_iconphotor	   rG  r   r<   r   ZsetupApprv   rl   newr=   ZisAquaTkdictr   lowerra   r^  environrn  rb   r  r   r  r   ZtkVersionWarningZinversedictrm  Zdestroy)Zenable_shellZenable_editre   cmdZscriptZstartupZoptsrD   r!  oard   Zpathxr   dirZ
edit_startr  Z	iconfilesZiconsr?  Ztkversionwarningr   )r  r  r   rR     s    
) 					
	
				$!


		
rR   r   F)Hr  r>   os.pathr{  r   r   r   r   r   r  	tracebacktypesrB   r   r  r   rg  r   r   ri  ImportErrorr   r   r  Ztkinter.messageboxZ
messageboxr}   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&   r)   
checkcacher1   r2   r   r   r   Z	RPCClientr   r   r   
TextIOBaser  rU  rS  r  rR   r   r   r   r   r   r   <module>   s~   	
	
	  h
