mς
­fIc           @   sQ   d  k  Z  d k Td  k Z d f  d     YZ d   Z e d j o e   n d  S(   N(   t   *t   FileListc           B   sf   t  Z d k l Z d   Z d  d  Z d  d  Z d  d  Z d   Z d   Z	 d   Z
 d	   Z RS(
   N(   s   EditorWindowc         C   s(   | |  _  h  |  _ h  |  _ h  |  _ d  S(   N(   t   roott   selft   dictt   inversedictt   vars(   R   R   (    (    t-   /mit/python/lib/python2.4/idlelib/FileList.pyt   __init__   s    			c         C   s½   |  i |  } t i i |  o( t i d d | f d |  i d  Sn t i i
 |  } |  i i |  o" |  i | } | i i   | Sn | o | |  Sn |  i |  | |  Sd  S(   Ns
   File Errors   %r is a directory.t   master(   R   t   canonizet   filenamet   ost   patht   isdirt   tkMessageBoxt	   showerrorR   t   Nonet   normcaset   keyR   t   has_keyt   editt   topt   wakeupt   actiont   EditorWindow(   R   R   R   R   R   (    (    R   t   open   s     	
c         C   s>   |  i |  } | d  j	 o | d  j	 o | i |  n d  S(   N(   R   R   R   R   R   t   linenot   gotoline(   R   R   R   R   (    (    R   t   gotofileline&   s    c         C   s   |  i |  |  S(   N(   R   R   R   (   R   R   (    (    R   t   new+   s    c         C   s<   x5 |  i i   D]$ } | i   } | d j o Pq q Wd S(   Nt   cancelt   break(   R   R   t   keysR   t   closet   reply(   R   t   eventR   R#   (    (    R   t   close_all_callback.   s     	c         C   sn   y |  i | } Wn t j
 o d GHd  Sn X| o |  i | =n |  i | =|  i p |  i i   n d  S(   Ns-   Don't know this EditorWindow object.  (close)(   R   R   R   R   t   KeyErrorR   R   t   quit(   R   R   R   (    (    R   t
   close_edit5   s    	

c         C   sK  | i   y |  i | } Wn t j
 o d GHd  Sn X| i i } | p* | o |  i | =n d  |  i | <d  Sn |  i
 |  } t i i |  } | | j o d  Sn |  i i |  o> |  i | } d  |  i | <t i d d | f d |  i n | |  i | <| |  i | <| o( y |  i | =WqGt j
 o qGXn d  S(   Ns.   Don't know this EditorWindow object.  (rename)s   Name Conflicts.   You now have multiple edit windows open for %rR	   (   R   t   saved_change_hookR   R   R   R&   t   ioR   R   R   R
   R   R   R   t   newkeyR   t   conflictR   R   R   (   R   R   R+   R   R   R,   (    (    R   t   filename_changed_editA   s:    
		
c         C   se   t  i i |  pB y t  i   } Wn t  i j
 o qU Xt  i i | |  } n t  i i |  S(   N(	   R   R   t   isabsR   t   getcwdt   pwdt   errort   joint   normpath(   R   R   R0   (    (    R   R
   a   s    (   t   __name__t
   __module__R   R   R   R   R   R   R%   R(   R-   R
   (    (    (    R   R      s   				 c          C   s   d k  l }  d  k } t   } |  |  | i   t |  } | i d o) x0 | i d D] } | i
 |  q[ Wn | i   | i o | i   n d  S(   N(   s   fixwordbreaksi   (   R   t   fixwordbreakst   syst   TkR   t   withdrawR   t   flistt   argvR   R   R   R   t   mainloop(   R6   R:   R7   R   R   (    (    R   t   _testl   s    		

 

t   __main__(   R   t   TkinterR   R   R=   R4   (   R=   R   R   R   (    (    R   t   ?   s   		f	