ó
§xxTc           @   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 m Z d  d l m Z m Z y d  d l TWn+ e k
 rý e j d IJe j d ƒ n Xd  d l 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) e j* e j+ d Z, d Z- d Z. y d  d l/ m0 Z0 Wn e k
 rd Z0 n Xe j a1 d  d l2 Z2 e3 d „ Z4 e3 e3 d „ Z5 e3 a6 d „  Z7 e7 e8 ƒ e3 e j9 d „ Z: e: e _9 d e f d „  ƒ  YZ; d e f d „  ƒ  YZ< d e f d  „  ƒ  YZ= d! e f d" „  ƒ  YZ> d# e& j? f d$ „  ƒ  YZ@ d% e f d& „  ƒ  YZA d' e! f d( „  ƒ  YZB d) e jC f d* „  ƒ  YZD d+ eD f d, „  ƒ  YZE d- eD f d. „  ƒ  YZF d/ ZG d0 „  ZH eI d1 k r�e jJ d1 e jJ d' <eH ƒ  n  e7 eK ƒ d S(2   iÿÿÿÿN(   t   InteractiveInterpreter(   t   python_versiont   system(   t   *sK   ** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **i   (   t   EditorWindowt   fixwordbreaks(   t   FileList(   t   ColorDelegator(   t   UndoDelegator(   t   OutputWindow(   t   idleConf(   t   idlever(   t   rpc(   t   Debugger(   t   RemoteDebugger(   t   macosxSupportt   _s	   127.0.0.1i    (   t   SIGTERMi   c         C   sy   d } | d | | f 7} | d k r; t j | | ƒ } n  | j ƒ  } | r^ | d | 7} n  | d | j |  f 7} | S(   s   Format warnings the IDLE way.s!   
Warning (from warnings module):
s     File "%s", line %s
s       %s
s   %s: %s
N(   t   Nonet	   linecachet   getlinet   stript   __name__(   t   messaget   categoryt   filenamet   linenot   linet   s(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   idle_formatwarning8   s    c         C   sf   | d k r t } n  y3 | j t |  | | | d | ƒƒ | j d ƒ Wn t t f k
 ra n Xd S(   s   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.
    R   s   >>> N(   R   t   warning_streamt   writeR   t   AttributeErrort   IOError(   R   R   R   R   t   fileR   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   idle_showwarningE   s    		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(   s>   Replace warning.showwarning with idle_showwarning, or reverse.N(   t   _warnings_showwarningR   t   warningst   showwarningR#   (   t   capture(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   capture_warningsX   s    		c         C   so   t  j } i  } xB t | ƒ D]4 } | d  | d d k r | j | ƒ | | <q q W| |  ƒ | j | ƒ d S(   so  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.
    i   iÿÿÿÿs   <>N(   R   t   cachet   listt   popt   update(   R   t   orig_checkcacheR)   t   savet   key(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   extended_linecache_checkcacheg   s    	
t   PyShellEditorWindowc           B   sƒ   e  Z d  Z d „  Z d d d d d g Z d „  Z d d „ Z d d „ Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z RS(   s6   Regular 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 „ } |  j j | ƒ |  j j rº |  j ƒ  n  d  S(   Ns   <<set-breakpoint-here>>s   <<clear-breakpoint-here>>s   <<open-python-shell>>s   breakpoints.lstc         S   s   | j  ƒ  |  ƒ  d  S(   N(   t   restore_file_breaks(   t   old_hookt   self(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   filename_changed_hook‹   s    
(   t   breakpointsR   t   __init__t   textt   bindt   set_breakpoint_heret   clear_breakpoint_heret   flistt
   open_shellt   ost   patht   joinR
   t   GetUserCfgDirt   breakpointPatht   iot   filename_change_hookt   set_filename_change_hookR   R2   (   R4   t   argsR5   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR7   �   s    		t   Cuts   <<cut>>t   rmenu_check_cutt   Copys   <<copy>>t   rmenu_check_copyt   Pastes	   <<paste>>t   rmenu_check_pastes   Set Breakpoints   <<set-breakpoint-here>>s   Clear Breakpoints   <<clear-breakpoint-here>>c         C   s¢   |  j  } |  j j } | j d d | d | d ƒ y |  j j | ƒ } Wn! t k
 rm |  j j | ƒ n Xy& |  j j	 j
 j } | j | | ƒ Wn n Xd  S(   Nt   BREAKs   %d.0i   (   R8   RC   R   t   tag_addR6   t   indext
   ValueErrort   appendR<   t   pyshellt   interpt   debuggerR:   (   R4   R   R8   R   t   it   debug(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   set_breakpoint›   s    	c         C   sU   |  j  } |  j j } | s) | j ƒ  d  St t | j d ƒ ƒ ƒ } |  j | ƒ d  S(   Nt   insert(   R8   RC   R   t   bellt   intt   floatRO   RW   (   R4   t   eventR8   R   R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR:   ©   s    	
c         C   s©   |  j  } |  j j } | s) | j ƒ  d  St t | j d ƒ ƒ ƒ } y |  j j | ƒ Wn n X| j	 d d d ƒ y& |  j
 j j j } | j | | ƒ Wn n Xd  S(   NRX   RM   s   insert linestarts   insert lineend +1char(   R8   RC   R   RY   RZ   R[   RO   R6   t   removet
   tag_removeR<   RR   RS   RT   R;   (   R4   R\   R8   R   R   RV   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR;   ²   s"    	
c         C   s‚   |  j  r~ |  j } |  j j } | s2 | j ƒ  d  Sg  |  _  | j d d t ƒ y# |  j j j	 j
 } | j | ƒ Wq~ q~ Xn  d  S(   NRM   s   1.0(   R6   R8   RC   R   RY   R^   t   ENDR<   RR   RS   RT   t   clear_file_breaks(   R4   R8   R   RV   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR`   Å   s    		
	c      	   C   sO  |  j  } |  j j } y+ t |  j d ƒ � } | j ƒ  } Wd QXWn t k
 rY g  } n XyŽ t |  j d ƒ �v } x1 | D]) } | j | d ƒ sy | j | ƒ qy qy W|  j	 ƒ  |  j  } | rá | j | d t
 | ƒ d ƒ n  Wd QXWn` t k
 rJ} t |  j d t ƒ sKt |  j _ t j d d d	 d
 t
 | ƒ d |  j ƒ qKn Xd S(   s#   Save breakpoints when file is savedt   rNt   wt   =s   
t   breakpoint_error_displayedt   titles
   IDLE ErrorR   s$   Unable to update breakpoint list:
%st   parent(   R6   RC   R   t   openRB   t	   readlinesR!   t
   startswithR   t   update_breakpointst   strt   getattrt   roott   Falset   TrueRd   t   tkMessageBoxt	   showerrorR8   (   R4   t   breaksR   t   old_filet   linest   new_fileR   t   err(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   store_file_breaksÔ   s.    	

	,c         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
 ƒ  } x_ | D]T } | j | d ƒ rp t | t | ƒ d ƒ } x | D] } |  j | ƒ qª Wqp qp Wn  d  S(   NRa   Rc   i   (   R8   R,   RC   R   R   R>   R?   t   isfileRB   Rg   Rh   Ri   t   evalt   lenRW   (   R4   R   Rt   R   t   breakpoint_linenumberst   breakpoint_linenumber(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR2     s    c         C   s4   |  j  } | j d ƒ } |  j | ƒ } | |  _ d S(   s3   Retrieves all the breakpoints in the current windowRM   N(   R8   t
   tag_rangest   ranges_to_linenumbersR6   (   R4   R8   t   rangest   linenumber_list(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRj     s    	c         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(   Ni    i   i   (   t   rangeRz   RZ   R[   t   stringRQ   (   R4   R   Rt   RO   R   t   end(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR~     s    c         C   s   |  j  ƒ  t j |  ƒ d S(   s7   Extend base method - clear breaks when module is closedN(   R`   R   t   _close(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR„   +  s    
(   RG   s   <<cut>>s   rmenu_check_cut(   RI   s   <<copy>>RJ   (   RK   s	   <<paste>>s   rmenu_check_pasteN(   s   Set Breakpoints   <<set-breakpoint-here>>N(   s   Clear Breakpoints   <<clear-breakpoint-here>>N(   R   t
   __module__t   __doc__R7   R   t   rmenu_specsRW   R:   R;   R`   Rw   R2   Rj   R~   R„   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR1   ~   s    						/			t   PyShellFileListc           B   s&   e  Z d  Z e Z d Z d d „ Z RS(   s8   Extend base class: IDLE supports a shell and breakpointsc         C   sQ   |  j  r |  j  j j ƒ  n. t |  ƒ |  _  |  j  rJ |  j  j ƒ  sJ d  Sn  |  j  S(   N(   RR   t   topt   wakeupt   PyShellt   beginR   (   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR=   :  s    		N(   R   R…   R†   R1   R   R   RR   R=   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRˆ   1  s   t   ModifiedColorDelegatorc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s8   Extend base class: colorizer for the shell window itselfc         C   s   t  j |  ƒ |  j ƒ  d  S(   N(   R   R7   t   LoadTagDefs(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR7   H  s    c         C   s7   |  j  d d d ƒ |  j d d d ƒ t j |  ƒ d  S(   Nt   TODOs   1.0t   iomarkt   SYNC(   R^   RN   R   t   recolorize_main(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR’   L  s    c         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(
   Nt   maint   Themet   namet
   backgroundt
   foregroundt   stdint   stdoutt   stderrt   console(   R   RŽ   R
   t	   GetOptiont   tagdefsR,   R   t   GetHighlight(   R4   t   theme(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRŽ   Q  s    c         C   s+   x$ |  j  D] } |  j | d d ƒ q
 Wd  S(   NR�   Rƒ   (   R�   R^   (   R4   t   tag(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   removecolors[  s    (   R   R…   R†   R7   R’   RŽ   R¡   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR�   E  s
   			
t   ModifiedUndoDelegatorc           B   s&   e  Z d  Z d d „ Z d d „ Z RS(   s;   Extend base class: forbid insert/delete before the I/O markc         C   s[   y- |  j  j | d d ƒ r, |  j  j ƒ  d  SWn t k
 r@ n Xt j |  | | | ƒ d  S(   Nt   <R�   (   t   delegatet   compareRY   t   TclErrorR   RX   (   R4   RO   t   charst   tags(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRX   c  s    c         C   sX   y- |  j  j | d d ƒ r, |  j  j ƒ  d  SWn t k
 r@ n Xt j |  | | ƒ d  S(   NR£   R�   (   R¤   R¥   RY   R¦   R   t   delete(   R4   t   index1t   index2(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR©   l  s    N(   R   R…   R†   R   RX   R©   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¢   `  s   	t   MyRPCClientc           B   s   e  Z d  „  Z RS(   c         C   s
   t  ‚ d S(   s0   Override the base class - just re-raise EOFErrorN(   t   EOFError(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt
   handle_EOFx  s    (   R   R…   R®   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¬   v  s   t   ModifiedInterpreterc           B   sF  e  Z d  „  Z d Z d Z d Z d „  Z d „  Z d „  Z	 e
 d „ Z d „  Z d „  Z d „  Z d „  Z e
 d	 „ Z d Z d
 „  Z d Z d „  Z d „  Z d „  Z d „  Z d Z d „  Z d d „ Z d „  Z d „  Z d „  Z d d „ Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d „  Z% d „  Z& d „  Z' RS(    c         C   sf   | |  _  t j d j } t j |  d | ƒd  |  _ t |  _	 d  |  _
 t |  _ |  j j j |  _ d  S(   Nt   __main__t   locals(   t	   tkconsolet   syst   modulest   __dict__R    R7   R   t   save_warnings_filtersRn   t
   restartingt   subprocess_arglistt   PORTt   portt   compilet   compilert   flagst   original_compiler_flags(   R4   R²   R±   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR7     s    					c         C   sL   |  j  d  k r! |  j ƒ  |  _  n  |  j  } t j t j t j | ƒ |  _ d  S(   N(	   R¸   R   t   build_subprocess_arglistR>   t   spawnvt   P_NOWAITR³   t
   executablet   rpcpid(   R4   RF   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   spawn_subprocess�  s    	c         C   s  |  j  d k s t d ƒ ‚ g  t j D] } d | ^ q% } d d d k r[ | j d ƒ n  t j d d d	 d
 t d d ƒ} t d k r˜ d | f } n d | f } t j	 d  d k r× d t j
 k r× d t j
 } n	 t j
 } | g | d | t |  j  ƒ g S(   Ni    s/   Socket should have been assigned a port number.s   -Wi   i   s   -QnewR“   t   Generals   delete-exitfunct   defaultt   typet   bools   idlelib.PyShells&   __import__('idlelib.run').run.main(%r)s   __import__('run').main(%r)i   t   wint    s   "%s"s   -c(   Rº   t   AssertionErrorR³   t   warnoptionsRQ   R
   Rœ   Rn   R   t   platformRÂ   Rk   (   R4   R   Rb   t	   del_exitft   commandt   decorated_exec(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¿   “  s    	 "	c         C   sÈ  t  |  j f } x\ t d ƒ D]@ } t j | ƒ y t | ƒ |  _ PWq t j k
 r[ } q 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  SX|  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 t ƒ |  j ƒ  |  j S(   Ni   i   i    i
   R›   R˜   R™   Rš   R<   R   RS   t   with_cwd(    t   HOSTRº   R�   t   timet   sleepR¬   t   rpccltt   sockett   errort   display_port_binding_errorR   t   listening_sockt   getsocknameR¹   t
   setsockoptt
   SOL_SOCKETt   SO_REUSEADDRRÄ   t
   settimeoutt   acceptt   timeoutt   display_no_subprocess_errort   registerR²   R˜   R™   Rš   R<   R   t   transfer_pathRo   t   poll_subprocess(   R4   t   addrRU   Rv   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   start_subprocess©  s>    



c         C   s±  |  j  r |  j St |  _  |  j ƒ  } | rL y t j |  j ƒ WqL qL Xn  |  j j ƒ  |  j ƒ  |  j } | j	 } t
 | _	 |  j ƒ  y |  j j ƒ  Wn! t j k
 r¼ } |  j ƒ  d  SX|  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 _  t
 |  _  |  j S(   NRÑ   R�   s   end-1cs   
i   i   Rc   s	    RESTART t   restartt   left(!   R·   RÕ   Ro   t   getdebuggerR   t   close_subprocess_debuggert   closet   unix_terminateR²   t	   executingRn   RÄ   Rß   RÖ   Rà   Rá   R   Rã   t   stop_readlineR8   R©   R   t
   showpromptRZ   t   widtht   mark_sett   mark_gravityt   restart_subprocess_debuggert   load_breakpointsR¾   R»   R¼   R½   (   R4   RÑ   RV   R›   t   was_executingRv   t   halfbart   gui(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   restart_subprocessÔ  sJ    		
			



	c         C   s   |  j  j d d d i  ƒ d  S(   Nt   exect   interrupt_the_server(    (   RÕ   t
   remotecall(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   __request_interrupt  s    c         C   s   t  j d |  j ƒ j ƒ  d  S(   Nt   target(   t	   threadingt   Threadt'   _ModifiedInterpreter__request_interruptt   start(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   interrupt_subprocess  s    c         C   sp   |  j  d  k	 r( |  j j j |  j  ƒ n  y |  j j ƒ  Wn t k
 rL n X|  j ƒ  t	 |  j _
 d  |  _ d  S(   N(   t   _afteridR   R²   R8   t   after_cancelRÕ   Rë   R    Rì   Rn   Rí   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   kill_subprocess  s    
c         C   sn   t  t d ƒ rj y t j |  j t ƒ Wn t k
 r: d SXy t j |  j d ƒ Wqj t k
 rf d SXn  d S(   s;   UNIX: make sure subprocess is terminated and collect statust   killNi    (   t   hasattrR>   R  RÃ   R   t   OSErrort   waitpid(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRì     s    c         C   sC   | r" d g } | j  t j ƒ n	 t j } |  j d | f ƒ d  S(   Nt    sR   if 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
(   t   extendR³   R?   t
   runcommand(   R4   RÑ   R?   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRã   !  s    		c         C   s™  |  j  } | d  k r d  Sy | j |  j d d ƒ} Wn: t t t f k
 rq |  j j r^ d  Sd  } |  j	 ƒ  n X| rb|  j j
 ƒ  d  |  _ | \ } } |  j j } | d k rÔ | d  k	 r:| t | ƒ IJq:nf | d k r|  j j d ƒ r:|  j ƒ  q:n8 | d k r:d } t j | I| IJ| | I| IJn  y |  j j ƒ  Wqbt k
 r^qbXn  |  j j s•|  j j j |  j j |  j ƒ |  _ n  d  S(   Nt   waitgš™™™™™©?t   OKt	   EXCEPTIONs   <<toggle-jit-stack-viewer>>t   ERRORs/   PyShell.ModifiedInterpreter: Subprocess ERROR:
(   RÕ   R   t   pollresponset
   active_seqR­   R!   t   KeyboardInterruptR²   t   closingRø   t   resetoutputR›   t   reprt   getvart   remote_stack_viewerR³   t
   __stderr__t   endexecutingR    R8   t   aftert   pollintervalRä   R  (   R4   t   cltt   responset   howt   whatR›   t   errmsg(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRä   0  s@    		c         C   s   | |  _  d  S(   N(   RT   (   R4   RT   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   setdebuggerX  s    c         C   s   |  j  S(   N(   RT   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRé   [  s    c         C   s   |  j  j j d |  j ƒ d S(   s’  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   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   open_remote_stack_viewer^  s    
c         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(   Niÿÿÿÿ(   t   RemoteObjectBrowserRù   t   stackviewerR<   (   t   ScrolledCanvast   TreeNodeR“   R”   R•   t   normalR–   t   bgt   highlightthicknessi    t   expandi   t   fillt   both(   s   flist(   t   idlelibR$  RÕ   t   remotequeueR   R²   Rm   RY   t   StubObjectTreeItemt   idlelib.TreeWidgetR&  R'  t   ToplevelR
   Rœ   Rž   t   framet   packt   canvasR+  (   R4   R$  t   oidt   itemR&  R'  R‰   RŸ   R–   t   sct   node(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR  k  s    i    c         C   s#   |  j  | ƒ } |  j | | ƒ d S(   s1   Like runsource() but assumes complete exec sourceN(   t   stuffsourcet   execfile(   R4   t   sourceR   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt
   execsource~  s    c         C   s¯   | d k r$ t | d ƒ j ƒ  } n  y t | | d ƒ } Wna t t f k
 r� |  j j ƒ  |  j j } | d IJ| d IJt	 j
 |  | ƒ |  j j ƒ  n X|  j | ƒ d S(   s   Execute an existing fileRa   Rù   s    *** Error in script or command!
s"   Traceback (most recent call last):N(   R   Rg   t   readR»   t   OverflowErrort   SyntaxErrorR²   R  Rš   R    t   showsyntaxerrorRï   t   runcode(   R4   R   R<  t   codet   tkerr(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR;  ƒ  s    

c         C   sì   |  j  | ƒ } d |  _ t j |  _ t j d d d t ƒ t | t j	 ƒ r¥ d d l
 m } y | j | j ƒ } Wq¥ t k
 r¡ |  j j ƒ  |  j d ƒ d SXn  z t j |  | | ƒ SWd |  j d k	 rç |  j t j (d |  _ n  Xd S(	   sB   Extend base class method: Stuff the source in the line cache firsti    t   actionR×   R   iÿÿÿÿ(   t	   IOBindings    Unsupported characters in input
N(   R:  t   moreR%   t   filtersR¶   t   filterwarningst   SyntaxWarningt
   isinstancet   typest   UnicodeTypeR.  RF  t   encodet   encodingt   UnicodeErrorR²   R  R   R    t	   runsourceR   (   R4   R<  R   RF  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRQ  “  s"    	c         C   sS   d |  j  } |  j  d |  _  | j d ƒ } t | ƒ d d | | f t j | <| S(   s"   Stuff source in the filename caches   <pyshell#%d>i   s   
i    (   t   gidt   splitRz   R   R)   (   R4   R<  R   Rt   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR:  ª  s
    #c         C   s   |  j  d | f ƒ d S(   s>   Prepend sys.path with file's directory if not already includeds(  if 1:
            _filename = %r
            import sys as _sys
            from os.path import dirname as _dirname
            _dir = _dirname(_filename)
            if not _dir in _sys.path:
                _sys.path.insert(0, _dir)
            del _filename, _sys, _dirname, _dir
            
N(   R  (   R4   R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   prepend_syspath²  s    c   
      C   s  |  j  j } |  j ƒ  } | rä | \ } } } } | d k rM d | d } n d | d | d f } | j d | ƒ | j | ƒ | j | ƒ }	 |	 r½ |	 t k r½ | j d | d | ƒ n  |  j  j ƒ  |  j d t	 | ƒ ƒ n |  j  j ƒ  t
 j |  | ƒ |  j  j ƒ  d S(   s˜   Extend base class method: Add Colorizing

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

        i   s   iomark + %d charss&   iomark linestart + %d lines + %d charsR  s
    wordstarts   SyntaxError: %s
N(   R²   R8   t   unpackerrorRN   t   seet   gett
   IDENTCHARSR  R   Rk   R    RA  Rï   (
   R4   R   R8   t   stufft   msgR   t   offsetR   t   post   char(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRA  ¾  s$    c   
      C   sƒ   t  j ƒ  \ } } } | t k } | re y+ | \ } \ } } } }	 | sQ d } n  Wqe d } qe Xn  | r{ | | | |	 f Sd  Sd  S(   Ni    (   R³   t   exc_infoR@  R   (
   R4   RÇ   t   valuet   tbt   okRZ  t   dummy_filenameR   R[  R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRU  Ú  s    c         C   sJ   |  j  j ƒ  |  j ƒ  t j |  ƒ |  j  j d ƒ rF |  j  j ƒ  n  d S(   s1   Extend base class method to reset output properlys   <<toggle-jit-stack-viewer>>N(   R²   R  t   checklinecacheR    t   showtracebackR  t   open_stack_viewer(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRd  é  s
    
c         C   sF   t  j } x6 | j ƒ  D]( } | d  | d d k r | | =q q Wd  S(   Ni   iÿÿÿÿs   <>(   R   R)   t   keys(   R4   t   cR/   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRc  ñ  s    	c         B   sQ   |  j  j r |  j ƒ  d S|  j rB |  j j d d | f i  ƒ n | |  j Ud S(   s*   Run the code without invoking the debuggeri    Rù   RB  i   (   R²   Rí   t   display_executing_dialogRÕ   R/  R±   (   R4   RC  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR  ÷  s    
	c         B   sÈ  |  j  j r |  j j ƒ  n  |  j ƒ  |  j d
 k	 rN |  j e j (d
 |  _ n  |  j	 } z;yr |  j  j
 ƒ  | r¤ |  j d
 k	 r¤ |  j j d d | f i  ƒ |  _ n' | rÀ | j | |  j ƒ n | |  j UWnÂ e k
 r%|  j  j se j d d d d d |  j  j ƒr‚  q"|  j ƒ  q‘‚  nl e rX|  j  j d IJ|  j ƒ  |  j  j ƒ  q‘|  j  j rƒe |  j  _ |  j  j d	 IJq‘|  j ƒ  n XWd
 e sÃy |  j  j ƒ  WqÃe k
 r¿qÃXn  Xd
 S(   s   Override base class methodRù   RB  s   Exit?s   Do you want to exit altogether?RÆ   t   yest   masters    IDLE internal error in runcode()R  N(   R²   Rí   RS   Rø   Rc  R¶   R   R%   RH  RT   t   beginexecutingRÕ   t
   asyncqueueR  t   runR±   t
   SystemExitR  Rp   t   askyesnoR8   Rd  t   use_subprocessRš   R  t   canceledRn   R    (   R4   RC  RT   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRB    sR    
	 

c         C   s   |  j  j j | ƒ d S(   s   Override base class methodN(   R²   Rš   R   (   R4   R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR   4  s    c         C   s    t  j d d d |  j j ƒd  S(   Ns   Port Binding ErrorsA  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.Rj  (   Rp   Rq   R²   R8   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRØ   8  s    c         C   s    t  j d d d |  j j ƒd  S(   Ns   Subprocess Startup Errors‰   IDLE's subprocess didn't make connection.  Either IDLE can't start a subprocess or personal firewall software is blocking the connection.Rj  (   Rp   Rq   R²   R8   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRá   C  s    c         C   s    t  j d d d |  j j ƒd  S(   Ns   Already executingsY   The Python Shell window is already executing a command; please wait until it is finished.Rj  (   Rp   Rq   R²   R8   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRh  K  s    N((   R   R…   R7   R   R  RÕ   RÃ   RÄ   R¿   Ræ   Rn   Rø   R   R  R  Rì   Rã   R  Rä   RT   R"  Ré   R#  R  RR  R=  R;  RQ  R:  RT  RA  RU  Rd  Rc  R  RB  R   RØ   Rá   Rh  (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¯   }  sH   	
			+.					&													1			R‹   c           B   sÔ  e  Z d  e ƒ  d Z e Z e Z d5 d6 d7 d8 d9 d: g Z e	 j
 d k rW d; e d <n  d d l m Z d< d „ Z d „  Z e Z e Z e Z e Z e Z e Z d „  Z d „  Z d< d „ Z d „  Z d< d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d  „  Z" d! „  Z# d" Z$ d# „  Z% d$ „  Z& d% „  Z' d& „  Z( d< d' „ Z) d( „  Z* d) „  Z+ d* „  Z, d+ „  Z- d, „  Z. d< d- „ Z/ d< d. „ Z0 d< d/ „ Z1 d0 „  Z2 d1 „  Z3 d= d2 „ Z4 d3 „  Z5 d4 „  Z6 RS(>   s   Python s    ShellR"   t   _Filet   editt   _EditRV   t   _Debugt   optionst   _Optionst   windowst   _Windowst   helpt   _Helpt   darwint   _Windowiþÿÿÿiÿÿÿÿ(   t   Historyc         C   sa  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  ƒ t |  _ d |  _ t |  _ |  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  |  j) |  j ƒ |  _* d |  _+ d  S(   Ni   i    t   shellt   She_lli   t   wrapR]  s   <<newline-and-indent>>s   <<plain-newline-and-indent>>s   <<interrupt-execution>>s   <<end-of-file>>s   <<open-stack-viewer>>s   <<toggle-debugger>>s   <<toggle-jit-stack-viewer>>s   <<view-restart>>s   <<restart-shell>>iÿÿÿÿ(   RF  R˜   R™   Rš   R›   i2   (   s   shellR€  (,   Rp  t
   menu_specsRX   R¯   RS   R   t   TkR   t   withdrawRˆ   R	   R7   Ro   t   usetabst   indentwidtht   context_use_ps1R8   t	   configureR9   t   enter_callbackt   linefeed_callbackt   cancel_callbackt   eof_callbackRe  t   toggle_debuggert   toggle_jit_stack_viewert   view_restart_markt   restart_shellR³   R™   t   save_stdoutRš   t   save_stderrR˜   t
   save_stdinR.  RF  t   PseudoInputFileRO  t   PseudoOutputFileR›   R~  t   historyR  (   R4   R<   t   msRm   R8   RF  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR7   l  sP    		

				c         C   s   t  j d t ƒ S(   Nt
   shell_only(   R
   t   GetExtensionsRo   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   get_standard_extension_namesž  s    c         C   s
   | a  d  S(   N(   R   (   R4   t   stream(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   set_warning_stream¨  s    c         C   s   t  S(   N(   R   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   get_warning_stream¬  s    c         C   s`   |  j  r0 t j d d d |  j ƒ|  j ƒ  d S|  j j ƒ  } | rR |  j ƒ  n
 |  j ƒ  d  S(   Ns   Don't debug nows*   You can only toggle the debugger when idleRj  t   break(	   Rí   Rp   Rq   R8   t   set_debugger_indicatorRS   Ré   t   close_debuggert   open_debugger(   R4   R\   t   db(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR�  ¯  s    		

c         C   s%   |  j  j ƒ  } |  j d | ƒ d  S(   Ns   <<toggle-debugger>>(   RS   Ré   t   setvar(   R4   R¢  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRŸ  ½  s    c         C   s   d  S(   N(    (   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRŽ  Á  s    c         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(   Ns   [DEBUG OFF]
s   >>> (   RS   Ré   R"  R   Rë   RÕ   R   t   close_remote_debuggerR  R›   R   R³   t   ps1Rï   RŸ  (   R4   R¢  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR   Ä  s    

	c         C   sq   |  j  j r' t j |  j  j |  ƒ } n t j |  ƒ } |  j  j | ƒ | j ƒ  d t _ |  j	 ƒ  |  j
 ƒ  d  S(   Ns   [DEBUG ON]
>>> (   RS   RÕ   R   t   start_remote_debuggerR   R"  Rô   R³   R¥  Rï   RŸ  (   R4   t   dbg_gui(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¡  Ñ  s    
	
c         C   s   |  j  ƒ  d |  _ d S(   s   Helper for ModifiedInterpreteri   N(   R  Rí   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRk  Ý  s    
c         C   s    d |  _  d |  _ |  j ƒ  d S(   s   Helper for ModifiedInterpreteri    N(   Rí   Rq  Rï   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR  â  s    		c         C   sf   |  j  r= t j d d d d d |  j ƒ} | t k r= d Sn  |  j ƒ  t |  _ t |  _ t	 j
 |  ƒ S(   s   Extend EditorWindow.close()s   Kill?s6   The program is still running!
 Do you want to kill it?RÆ   Ra  Rf   t   cancel(   Rí   Rp   t   askokcancelR8   Rn   Rî   Ro   Rq  R  R   Rë   (   R4   R  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRë   è  s    	
		c         C   s|   |  j  ƒ  t r  |  j j ƒ  n  |  j t _ |  j t _ |  j	 t _
 d |  _ d |  _ d |  j _ d |  _ t j |  ƒ d S(   sE   Extend EditorWindow._close(), shut down debugger and execution serverN(   R   Rp  RS   R  R‘  R³   R™   R’  Rš   R“  R˜   R   R›   R<   RR   R–  R   R„   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR„   ÷  s    
			c         C   s   t  S(   s8   Override EditorWindow method: never remove the colorizer(   Ro   (   R4   R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   ispythonsource  s    c         C   s   |  j  S(   N(   t   shell_title(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   short_title  s    s@   Type "copyright", "credits" or "license()" for more information.c         C   s‹   |  j  ƒ  t r< d } |  j j ƒ  } | sB |  j ƒ  t Sn d } |  j d t j t j	 |  j
 | f ƒ |  j ƒ  d d  l } d  | _ t S(   NR
  s   ==== No Subprocess ====s   Python %s on %s
%s
%siÿÿÿÿ(   R  Rp  RS   Ræ   Rë   Rn   R   R³   t   versionRÍ   t	   COPYRIGHTRï   t   TkinterR   t   _default_rootRo   (   R4   t   nosubt   clientR¯  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRŒ     s    

	
	c         C   s'   |  j  s d  St |  _ |  j j ƒ  d  S(   N(   t   readingRo   t   _stop_readline_flagR‰   t   quit(   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRî   "  s    		c         C   s  |  j  } z d |  _  |  j j ƒ  Wd  | |  _  X|  j rF t |  _ d S|  j j d d ƒ } t | ƒ d k rv d } n  t | t	 ƒ rÂ d d l
 m } y | j | j ƒ } WqÂ t k
 r¾ qÂ Xn  |  j ƒ  |  j rð d |  _ t sð t ‚ qð n  |  j rd |  _ d } n  | S(	   Ni   R
  R�   s   end-1ci    s   
iÿÿÿÿ(   RF  (   R³  R‰   t   mainloopR´  Rn   R8   RW  Rz   RK  t   unicodeR.  RF  RN  RO  RP  R  Rq  Rp  R  t	   endoffile(   R4   R.   R   RF  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   readline(  s4    		
			
					c         C   s   t  S(   N(   Ro   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   isattyE  s    c         C   s×   y  |  j  j d d d ƒ r d  SWn n X|  j p9 |  j sd |  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(   Ns	   sel.firsts   !=s   sel.lasts   KeyboardInterrupt
Rž  i    i   (   R8   R¥   Rí   R³  R  RS   R   Rï   R¸  Rq  RÕ   Ré   Rø   R  R‰   Rµ  (   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR‹  H  s&    

			c         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�   s   ==RX   s   end-1ci    i   Rž  (
   Rí   R³  R8   R¥   R  Rë   Rq  R¸  R‰   Rµ  (   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRŒ  ^  s    	
		c         C   s@   |  j  r/ |  j j d d ƒ |  j j d ƒ n |  j | ƒ d S(   NRX   s   
Rž  (   R³  R8   RX   RV  t   newline_and_indent_event(   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRŠ  m  s
    	c         C   sù  |  j  r |  j r d  SyN |  j j d d ƒ } | rd |  j j d d d ƒ rd |  j | | ƒ d Sn  Wn n 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 ƒ } | rK|  j j d d | d ƒ rK|  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 ƒ } | r7| j	 ƒ  r7|  j j
 d d ƒ n  |  j j d d d ƒ r`|  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(   Ns	   sel.firsts   sel.lasts   <=R�   Rž  RX   R£   s   iomark linestartR˜   i   i    s   insert lineends   >=R›   s   insert linestarts   end-1cs   end-1c linestarts   
(   Rí   R³  R8   RW  R¥   t   recallt   tag_prevranget   tag_nextrangeRñ   R   R©   R»  RX   RV  RN   t   update_idletasksR‰   Rµ  t   runit(   R4   R\   t   selt   prevt   nextt   indicesR   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR‰  v  sX    "'"'&		
c         C   s«  t  j d d | ƒ } t  j d d | ƒ } | j d ƒ } |  j j ƒ  z@|  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 ƒ } xX | d D]I } | j | ƒ ra| | t | ƒ } n  |  j j d d | j ƒ  ƒ q5Wn  Wd  |  j j d ƒ |  j j ƒ  Xd  S(   Ns   ^\s*\nR
  s   \n\s*$s   
RÁ  s   1.0Rƒ   RX   s   end-1cs   insert linestartt   :i    i   s	   ^([ \t]*)(   t   ret   subRS  R8   t   undo_block_startR^   Rñ   RW  t   rstript   endswithR»  RX   R   Rz   t   searcht   groupRi   RV  t   undo_block_stop(   R4   R   R\   Rt   t   prefixt   orig_base_indentt   new_base_indentR   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¼  µ  s*    (c         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| |  } |  j j | ƒ } d  S(   NR�   s   end-1ci    i   s    	s   
(   R8   RW  Rz   RS   RQ  (   R4   R   RU   RG  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRÀ  Ï  s    # #
c         C   sq   |  j  j r |  j  j ƒ  Sy t j Wn! t j d d d |  j ƒd  SXd d l m	 } | |  j
 |  j ƒ } d  S(   Ns   No stack traces@   There is no stack trace yet.
(sys.last_traceback is not defined)Rj  iÿÿÿÿ(   t   StackBrowser(   RS   RÕ   R  R³   t   last_tracebackRp   Rq   R8   t   idlelib.StackViewerRÑ  Rm   R<   (   R4   R\   RÑ  t   sv(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRe  Ý  s    	
c         C   s$   |  j  j d ƒ |  j  j d ƒ d  S(   NR�   Rç   (   R8   RV  (   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR�  ë  s    c         C   s   |  j  j d t ƒ d S(   s&   Callback for Run/Restart Shell Cntl-F6RÑ   N(   RS   Rø   Ro   (   R4   R\   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR�  ï  s    c         C   sk   |  j  ƒ  y t t j ƒ } Wn d } n X|  j j | ƒ |  j j d d ƒ |  j ƒ  |  j	 j
 ƒ  d  S(   NR
  RX   s   end-1c(   R  Rk   R³   R¥  R›   R   R8   Rñ   t   set_line_and_columnRC   t
   reset_undo(   R4   R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRï   ó  s    


c         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 t j _	 d  S(   NR�   s   end-1cs   end-2cs   
i    (
   R8   RW  R–  t   storeRX   Rñ   RÕ  R³   R™   t	   softspace(   R4   R<  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR  þ  s    	
c         C   sr   y@ |  j  j d d ƒ t j |  | | d ƒ |  j  j d d ƒ Wn n X|  j rn d |  _ t sn t ‚ qn n  d  S(   NR�   t   rightRè   i    (   R8   Rò   R	   R   Rq  Rp  R  (   R4   R   R¨   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR     s    		c         C   sH   y  |  j  j d d d ƒ r d SWn t k
 r4 d SXt t |  ƒ j ƒ  S(   Ns	   sel.firstR£   R�   t   disabled(   R8   R¥   R¦   t   superR‹   RH   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRH     s    c         C   s/   |  j  j d d d ƒ r d St t |  ƒ j ƒ  S(   NRX   R£   R�   RÚ  (   R8   R¥   RÛ  R‹   RL   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRL     s    (   s   fileRr  (   Rs  Rt  (   s   debugRu  (   Rv  Rw  (   Rx  Ry  (   s   helpR{  (   Rx  R}  N(    (7   R   R…   R   R«  R�   R   R¢   R   R‚  R³   RÍ   t   idlelib.IdleHistoryR~  R   R7   Rš  Rn   R³  Rí   Rq  R¸  R  R´  Rœ  R�  R�  RŸ  RŽ  R   R¡  Rk  R  Rë   R„   Rª  R¬  R®  RŒ   Rî   R¹  Rº  R‹  RŒ  RŠ  R‰  R¼  RÀ  Re  R�  R�  Rï   R  R   RH   RL   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR‹   S  sh   	2																				?				
	t
   PseudoFilec           B   s;   e  Z d d  „ Z e d „  ƒ Z e d „  ƒ Z d „  Z RS(   c         C   s(   | |  _  | |  _ d |  _ | |  _ d  S(   Ni    (   R  R¨   RØ  t	   _encoding(   R4   R  R¨   RO  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR7   #  s    			c         C   s   |  j  S(   N(   RÞ  (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRO  )  s    c         C   s   d |  j  S(   Ns   <%s>(   R¨   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR•   -  s    c         C   s   t  S(   N(   Ro   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRº  1  s    N(   R   R…   R   R7   t   propertyRO  R•   Rº  (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRÝ  !  s   R•  c           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  S(   N(   Ro   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   writable7  s    c         C   sÎ   |  j  r t d ƒ ‚ n  t | ƒ t t t f k r¸ t | t ƒ rZ t j | d  d  ƒ } q¸ t | t ƒ r{ t j	 | ƒ } q¸ t | t ƒ rœ t j	 | ƒ } q¸ t
 d t | ƒ j ƒ ‚ n  |  j j | |  j ƒ S(   Ns   write to closed files   must be string, not (   t   closedRP   RÇ   R·  Rk   t	   bytearrayRK  t   __getslice__R   t   __str__t	   TypeErrorR   R  R   R¨   (   R4   R   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR   :  s    	(   R   R…   Rà  R   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR•  5  s   	R”  c           B   s>   e  Z d d  „ Z d „  Z d d „ Z d d „ Z d „  Z RS(   c         C   s#   t  j |  | | | ƒ d |  _ d  S(   NR
  (   RÝ  R7   t   _line_buffer(   R4   R  R¨   RO  (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR7   L  s    c         C   s   t  S(   N(   Ro   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   readableP  s    iÿÿÿÿ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ƒ t	 r¥ |  j
 j ƒ  } | s˜ Pn  | | 7} qy WnS x9 t | ƒ | k  rä |  j
 j ƒ  } | s× Pn  | | 7} q¬ W| | |  _ | |  } | S(   Ns   read from closed fileiÿÿÿÿs   must be int, not R
  i    (   Rá  RP   R   RK  RZ   Rå  RÇ   R   Ræ  Ro   R  R¹  Rz   (   R4   t   sizet   resultR   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR>  S  s,    					  
c         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  | | |  _ | |  S(   Ns   read from closed fileiÿÿÿÿs   must be int, not i    s   
i   (   Rá  RP   R   RK  RZ   Rå  RÇ   R   Ræ  R  R¹  Rz   t   find(   R4   Rè  R   t   eol(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR¹  j  s    		c         C   s   |  j  j ƒ  d  S(   N(   R  Rë   (   R4   (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyRë   z  s    N(   R   R…   R   R7   Rç  R>  R¹  Rë   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR”  J  s
   	s‡  
USAGE: idle  [-deins] [-t title] [file]*
       idle  [-dns] [-t title] (-c cmd | -r file) [arg]*
       idle  [-dns] [-t title] - [arg]*

  -h         print this help message and exit
  -n         run IDLE without a subprocess (see Help/IDLE Help for details)

The following options will override the IDLE 'settings' configuration:

  -e         open an edit window
  -i         open a shell window

The following options imply -i and will open a shell:

  -c cmd     run the command in a shell, or
  -r file    run script from file

  -d         enable the debugger
  -s         run $IDLESTARTUP or $PYTHONSTARTUP before anything else
  -t title   set title of shell window

A default edit window will be bypassed when -c, -r, or - are used.

[arg]* are passed to the command (-c) or script (-r) in sys.argv[1:].

Examples:

idle
        Open an edit window or shell depending on IDLE's configuration.

idle foo.py foobar.py
        Edit the files, also open a shell if configured to start with shell.

idle -est "Baz" foo.py
        Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
        window with the title "Baz".

idle -c "import sys; print sys.argv" "foo"
        Open a shell window and run the command, passing "-c" in sys.argv[0]
        and "foo" in sys.argv[1].

idle -d -s -r foo.py "Hello World"
        Open a shell window, run a startup script, enable the debugger, and
        run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
        sys.argv[1].

echo "import sys; print sys.argv" | idle - "foobar"
        Open a shell window, run the script piped in, passing '' in sys.argv[0]
        and "foobar" in sys.argv[1].
c          C   s±  t  t ƒ t a t }  t } t } d  } d  } t } y# t j t j d d ƒ \ } } WnM t j k
 r¦ } t j	 j
 d t | ƒ ƒ t j	 j
 t ƒ t j d ƒ n Xx.| D]&\ }	 }
 |	 d k rÕ |
 } t }  n  |	 d k rð t } t }  n  |	 d k rt } n  |	 d k r.t j j
 t ƒ t j ƒ  n  |	 d	 k rCt }  n  |	 d
 k rXt a n  |	 d k r›|
 } t j j | ƒ rn d G| GHt j ƒ  t }  n  |	 d k r¶t } t }  n  |	 d k r® |
 t _ t }  q® q® W| r| d d k rt j j ƒ  } t }  n  x= t t t j ƒ ƒ D]& } t j j t j | ƒ t j | <qW| rs| d d k rsd g | d t _ nê | rŒd g | t _ nÑ | r¥| g | t _ n¸ | r,t } 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 | ƒ n� t% d k r•t% d k rd n d  } g  d- D]% } t j j! | d$ | | f ƒ ^ q#} g  | D] } t& d% | ƒ ^ qU} t  j' j( d& d' t t  ƒ d( | Œ n  t) t  ƒ t  j* ƒ  t+ t  ƒ a, t- j. t  t, ƒ | r'| pÔ| s'x4 | D]+ } t, j/ | ƒ d  k rß| j0 | ƒ qßqßW| s$t, j1 ƒ  q$q'n  |  rkt, j2 ƒ  } | sCd  St- j3 ƒ  rtt, j4 rt| j5 j6 ƒ  qtn	 t, j7 } | r‡| j8 ƒ  n  | rßt j9 j: d) ƒ p®t j9 j: d* ƒ } | rßt j j | ƒ rß| j; j< | ƒ qßn  | së| rJ| j; j= d+ t j f ƒ | r| j; j> | ƒ q| r| j; j? | ƒ | j; j< | ƒ qn5 | rt- j@ t  ƒ } | r| j; j= d, | ƒ qn  x t, jA r˜t  jB ƒ  q‚Wt  jC ƒ  t  t ƒ d  S(.   Ni   s   c:deihnr:st:s
   Error: %s
i   s   -cs   -ds   -es   -hs   -is   -ns   -rs   No script file: s   -ss   -ti    t   -R
  R“   RÅ   s   editor-on-startupRÇ   RÈ   t	   classNamet   Idlet   Iconst   Windowss   idle.icoRÆ   g      !@g333333!@s   .pngs   .gifi   i    i0   s	   idle_%d%sR"   t   wmt	   iconphotos   -defaultt   IDLESTARTUPt   PYTHONSTARTUPsb   if 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
s   print('%s')(   i   i    i0   (D   R(   Ro   Rp  Rn   R   t   getoptR³   t   argvR×   Rš   R   Rk   t	   usage_msgt   exitR™   R>   R?   Rx   R‹   R«  R˜   R>  R�   Rz   t   abspathRQ   t   dirnameRX   t   getcwdR
   Rœ   Rƒ  Rm   R@   t   __file__R   t   wm_iconbitmapt	   TkVersiont
   PhotoImaget   tkt   callR   R„  Rˆ   R<   R   t   setupAppRg   R]   t   newR=   t   isAquaTkt   dictR‰   t   lowerRR   R¡  t   environRW  RS   R;  R  R=  RT  t   tkVersionWarningt   inversedictR¶  t   destroy(   t   enable_shellt   enable_editRV   t   cmdt   scriptt   startupt   optsRF   RZ  t   ot   aRU   t   pathxR   t   dirt
   edit_startt   icondirt   iconfilet   extRè  t	   iconfilest   iconsR  t   tkversionwarning(    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyR“   ³  sô    
#						
				$!/"%

		
R°   (L   R>   t   os.pathR³   R‚   Rõ  RÆ  RÖ   RÓ   Rþ   t	   tracebackRL  RC   R   RC  R    RÍ   R   R   R¯  t   ImportErrorR  Rø  Rp   t   idlelib.EditorWindowR   R   t   idlelib.FileListR   t   idlelib.ColorDelegatorR   t   idlelib.UndoDelegatorR   t   idlelib.OutputWindowR	   t   idlelib.configHandlerR
   R.  R   R   R   R   R   t   ascii_letterst   digitsRX  RÒ   R¹   t   signalR   R   R%   R   R   R#   R$   R(   Ro   t
   checkcacheR0   R1   Rˆ   R�   R¢   t	   RPCClientR¬   R¯   R‹   t
   TextIOBaseRÝ  R•  R”  R÷  R“   R   R´   Rn   (    (    (    s;   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/idlelib/PyShell.pyt   <module>   s„   
		
	³ÿ ×ÿ Ïg	™
