
"Ic           @   s  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k l Z d  d k Td  d k Z d  d k Z d  d k	 l
 Z
 d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k l Z d  d k Z d  d k Z d  d k Z d  d k Z d Z e d  Z d e f d	     YZ d
   Z d   Z d  d k Z e Z  [ d e f d     YZ! d   Z" h d d 6d d 6d d 6Z# d   Z$ d   Z% d   Z& e' d j o e&   n d S(   iN(   t   count(   t   *(   t   MultiCallCreator(   t   idleConfi   c         C   s   d } x |  i d  D] } | d j	 o | i   n t i | |  \ } } } | d t i j o Pn t i | | | |  } y | i } Wq t j
 o t	 d | i
  q Xq W| | | f S(   sC   Version of imp.find_module() that handles hierarchical module namest   .i   s   No source for module N(   t   Nonet   splitt   closet   impt   find_modulet	   PY_SOURCEt   load_modulet   __path__t   AttributeErrort   ImportErrort   __name__(   t   fullnamet   patht   filet   tgtt   filenamet   descrt   module(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   _find_module   s     t   EditorWindowc           B   sn  e  Z d  d k l Z d  d k l Z d  d k l Z d  d k l Z l Z l Z d  d k Z d  d k	 l
 Z
 d  d k l Z d Z d d d d d  Z d	   Z d
   Z d   Z d   Z d d  Z d{ d| d} d~ d d d g Z e i   o e d =d e d <n d   Z d    Z d Z d!   Z d g Z d$   Z d d%  Z d d&  Z d d'  Z d d(  Z  d)   Z! d*   Z" d+   Z# d d,  Z$ d d-  Z% d.   Z& d/   Z' d0   Z( d1   Z) d2   Z* d3   Z+ d4   Z, d5   Z- d6   Z. d d7  Z/ d d8  Z0 d d9  Z1 d:   Z2 d;   Z3 d<   Z4 d=   Z5 d>   Z6 d?   Z7 d@   Z8 dA   Z9 dB   Z: dC   Z; dD   Z< dE   Z= dF   Z> dG   Z? d dH  Z@ dI   ZA dJ   ZB dK   ZC dL   ZD dM   ZE dN   ZF dO   ZG dP   ZH dQ dR  ZI dS   ZJ dQ dT  ZK dU   ZL dV   ZM dW   ZN dX   ZO dY   ZP dZ   ZQ d[   ZR d\   ZS d]   ZT d^   ZU d d_  ZV d d d`  ZW da   ZX d db  ZY d dc  ZZ dd   Z[ de   Z\ df   Z] dg   Z^ e_ dh  Z` di   Za dj   Zb dk   Zc dl   Zd dm   Ze dn   Zf do   Zg dp   Zh dq   Zi dr   Zj ds   Zk dt   Zl du   Zm dv   Zn dw   Zo dx   Zp dy   Zq dz   Zr RS(   i(   t
   Percolator(   t   ColorDelegator(   t   UndoDelegator(   t	   IOBindingt   filesystemencodingt   encodingN(   t   Toplevel(   t   MultiStatusBarc         C   s	  t  i d  j olt i i t i d d  } t i i	 d  oW d d t i
 d  } t i i d  o
 d } qd	 } t i i | | d d  } n t i d  d
 j oG t i i t i d d t i
 d   } t i i |  o
 | } qn* t i   o t i i t i d  } n t i i |  } t i i |  o1 | t  _ t i d j o d t  i t  _ qxq|d t  _ n t i   }	 | |  _ | p | i } | |  _ y t i Wn t j
 o d t _ n Xt |  |  _ t i | d |  i |  _ }
 | o | i |  _ | i |  i _ n h  |  _ h  |  i _ t i i t i   d  |  _  t! |
  |  _" } t# | d d |  _$ } t i% d d d  |  _& t' t(  | d d d d d d d |  i& d t i% d d d  |  _) } |  i) |  i _* |  i+   |  i,   |  i i- d |  i.  |  i i/ d  |  i0  t i   o | i/ d  |  i0  n | i/ d! |  i1  | i/ d" |  i2  | i/ d# |  i3  | i/ d$ |  i4  | i/ d% |  i5  | i/ d& |  i6  | i/ d' |  i7  | i/ d( |  i8  | i/ d) |  i9  | i/ d* d+    | i/ d, |  i:  | i/ d- |  i;  | i/ d. |  i<  | i/ d/ |  i=  | i/ d0 |  i>  | i/ d1 |  i?  | i/ d2 |  i@  | i/ d3 |  iA  | i/ d4 |  iB  | i/ d5 |  iC  | i/ d6 |  iD  | i/ d7 |  iE  | i/ d8 |  iF  | i/ d9 |  iG  | i/ d: |  iH  | i/ d; |  iI  | i/ d< |  iJ  | i/ d= |  iK  | i/ d> |  iL  | i/ d? |  iM  | i/ d@ |  iN dA   | i/ dB |  iN dC   | i/ dD |  iO  | i/ dE |  iP  | i/ dF |  iQ  | ox | | i |  <| o |  | iR | <n | i/ dG |  iS  | i/ dH |  i iT  | i/ dI |  iU  | i/ dJ |  iV  n |  iW   | iX | dK <| iY dL tZ dM t[  | i\ | dN <dO } t i% d d dP dQ dR o
 dS } n | i] dT t i% d d dT  t i% d d dU  | f  | iY dL t^ dM t_ dV dC  | iY dL t` dM t_ dV dC  | ia   t i% d dW dX dQ dR } | |  _b dY |  _c |  ic |  _d |  ie   tf |  _g dd |  _h |  ii |  |  _j } |  ik   |  _l } | im |  | in | _n | io | _o | ip |  iq  |  ir |   |  _s } | it |  iu  t |  i  |  _v |  iw d] ix d d^ d_ d` dA d |  iv |  iy   d  |  _z | oI t i i{ |  o% t i i |  o | i| |  q| i} |  n |  i~   |  iq   |  i |  i |   |  i   |  iw i da  } | oh | i db  } | d  j o
 dc } n | dA j o | i   | dC } n | |  _ t i |  i  n t i |  _ t i |  _ t i |  _ d  S(e   Nt   Docs
   index.htmlt   linuxs   python-docs-s   %s.%s.%si   s   /var/www/html/python/s   /var/www/html/python/index.htmls   /usr/share/doc/t   wins   Python%d%d.chmi   s0   Resources/English.lproj/Documentation/index.htmlt   darwins   file://s!   http://www.python.org/doc/currents   >>> t   menus   recent-files.lstt   namet   vbart   mainR   t   widtht   textt   padxi   t   wrapt   nonet   heightt   WM_DELETE_WINDOWs   <<close-window>>s   <<cut>>s   <<copy>>s	   <<paste>>s   <<center-insert>>s   <<help>>s   <<python-docs>>s   <<about-idle>>s   <<open-config-dialog>>s   <<open-module>>s   <<do-nothing>>c         S   s   d  S(   t   break(    (   t   event(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   <lambda>   s    s   <<select-all>>s   <<remove-selection>>s   <<find>>s   <<find-again>>s   <<find-in-files>>s   <<find-selection>>s   <<replace>>s   <<goto-line>>s   <3>s   <<smart-backspace>>s   <<newline-and-indent>>s   <<smart-indent>>s   <<indent-region>>s   <<dedent-region>>s   <<comment-region>>s   <<uncomment-region>>s   <<tabify-region>>s   <<untabify-region>>s   <<toggle-tabs>>s   <<change-indentwidth>>s   <Left>i    s   <Right>i   s   <<del-word-left>>s   <<del-word-right>>s   <<beginning-of-line>>s   <<open-new-window>>s   <<close-all-windows>>s   <<open-class-browser>>s   <<open-path-browser>>t   commandt   sidet   fillt   yscrollcommandt   normals	   font-boldt   typet   boolt   boldt   fonts	   font-sizet   expandt   Indents
   use-spacesi   i2   i  i@KL R   t   labels   Recent Filest	   underlinet   windowst   endi(   i2   i  i@KL (   R   t   help_urlR   t   osR   t   joint   syst   prefixt   platformR    t   version_infot   isdirt   isfilet   macosxSupportt   runningAsOSXAppt   normpathR   t   CurrentThemet   flistt   roott   ps1R   t   Menut   menubart
   WindowListt   ListedToplevelt   topt   varst   tkinter_varst   inversedictt   instance_dictt   GetUserCfgDirt   recent_files_patht   Framet
   text_framet	   ScrollbarR'   t	   GetOptionR)   R   t   TextR*   t   focused_widgett   createmenubart   apply_bindingst   protocolR   t   bindt   close_eventt   cutt   copyt   pastet   center_insert_eventt   help_dialogt   python_docst   about_dialogt   config_dialogt   open_modulet
   select_allt   remove_selectiont
   find_eventt   find_again_eventt   find_in_files_eventt   find_selection_eventt   replace_eventt   goto_line_eventt   right_menu_eventt   smart_backspace_eventt   newline_and_indent_eventt   smart_indent_eventt   indent_region_eventt   dedent_region_eventt   comment_region_eventt   uncomment_region_eventt   tabify_region_eventt   untabify_region_eventt   toggle_tabs_eventt   change_indentwidth_eventt   move_at_edge_if_selectiont   del_word_leftt   del_word_rightt   home_callbackt   dictt   new_callbackt   close_all_callbackt   open_class_browsert   open_path_browsert   set_status_bart   yviewt   packt   RIGHTt   Yt   sett   configt   LEFTt   BOTHt   TOPt	   focus_sett   usetabst   tabwidtht   indentwidtht   set_notabs_indentwidtht   Falset   context_use_ps1t   num_context_linesR   t   perR   t   undot   insertfiltert   undo_block_startt   undo_block_stopt   set_saved_change_hookt   saved_change_hookR   t   iot   set_filename_change_hookt   filename_change_hookt   recent_files_menut   menudictt   insert_cascadet   update_recent_files_listt   colort   existst   loadfilet   set_filenamet   ResetColorizert   set_indentation_paramst   ispythonsourcet   load_extensionst   gett   indext   add_separatort	   wmenu_endt   register_callbackt   postwindowsmenut   tkMessageBoxt   askyesnot   tkSimpleDialogt
   askintegert	   showerror(   t   selfRO   R   t   keyRP   t   dochomet   pyvert   basepatht   chmfilet   currentThemeRV   R^   R'   R*   t
   fontWeightt	   usespacesR   R   R   R%   RA   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   __init__5   s0   
						






	
		

	'




	c         C   s   t  | t  p | o | Sy | i |  i  SWnG t j
 o; y | i |  i  SWq{ t j
 o | i d  SXn Xd S(   s8   convert filename to unicode in order to display it in Tks	   iso8859-1N(   t
   isinstancet   unicodet   decodeR   t   UnicodeDecodeErrorR   (   R   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   _filename_to_unicode	  s    c         C   s)   |  i  i   \ } } |  i i |  d S(   NR0   (   R   t   defaultfilenameRO   t   new(   R   R1   t   dirnamet   basename(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    c         C   s4  | i  d @d j o | i d j o d  S|  i i d  o[ |  i i d d d  oB |  i i d d d  o) t |  i i d  i d  d	  } nU |  i i d d  } x< t t	 |   D] } | | d j o Pq q Wt	 |  } t |  i i d  i d  d	  } | | j o
 d } n d t
 |  d } | i  d	 @d j o |  i i d d d  n |  i i d  p |  i i d d  n |  i i |  } |  i i d  } |  i i | d |  o | | } } n |  i i d d d  |  i i d | |  |  i i d |  |  i i d  d S(   Ni   i    t   Homet   iomarks   <=s   insert lineends   insert linestartR   i   t    s   	t   inserts   insert linestart+t   ct   sels   1.0RA   s	   sel.firstt   anchort   >R0   (   R   s   	(   t   statet   keysymR*   R   t   comparet   intR   R   t   xranget   lent   strt
   tag_removet   mark_sett   tag_addt   see(   R   R1   t   insertptt   linet   lineatt   destt   firstt   last(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s:    $) 	%
c         C   s   |  i  |  i  |  _ t i   o |  i i d d d t n |  i i d d d t |  i i d d d t |  i i d t d t	  |  i
 i d	 |  i  |  i
 i d	 d
 d  |  i
 i |  i  d  S(   Nt	   _padding1s       R4   t   columns   Col: ?R   s   Ln: ?R5   s   <<set-line-and-column>>s   <KeyRelease>s   <ButtonRelease>(   R    RV   t
   status_barRK   RL   t	   set_labelR   R   t   BOTTOMt   XR*   Rf   t   set_line_and_columnt	   event_addt
   after_idle(   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   I  s    
c         C   sS   |  i  i t  i d  \ } } |  i i d d |  |  i i d d |  d  S(   NR   R   s   Col: %sR   s   Ln: %s(   R*   R   t   INSERTR   R   R   (   R   R1   R   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   W  s    !R   t   _Filet   editt   _Editt   formatt   F_ormatt   runt   _Runt   optionst   _OptionsR@   t   _Windowst   helpt   _Helpit   _Windowic         C   s   |  i  } h  |  _ } x_ |  i D]T \ } } t |  \ } } t | d | | | <} | i d | d | d |  q  Wt i d j oD d t i j o4 t | d d | d <} | i d d	 d |  n |  i	   |  i d
 i
 t  |  _ |  i   d  S(   NR&   R>   R%   R?   R$   s
   .frameworkt   applet   applicationt   IDLER  (   RS   R   t
   menu_specst   prepstrRR   t   add_cascadeRE   RG   t
   executablet
   fill_menusR   t   ENDt   base_helpmenu_lengtht   reset_help_menu_entries(   R   t   mbarR   R&   R>   R?   R%   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRc   k  s    	
   
c         C   so   |  i  d } | i d  } | d  j o
 d } n | |  i j o | i |  i d |  n t i |  d  S(   NR@   RA   ii   (   R   R   R   R   t   deleteRT   t   add_windows_to_menu(   R   R%   RA   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   |  s    
c         C   s   |  i  i d d d  |  i  i d d | i | i f  |  i p |  i   n |  i } | |  _ t i	 d  d j } | o |  i  i
 d d	  n | i | i | i  | o |  i  i
 d d
  n d  S(   NR   s   1.0RA   R   s   @%d,%di   R#   t   cursort   arrowt   ibeam(   R*   R   R   t   xt   yt   rmenut
   make_rmenuR1   RE   RG   R   t   tk_popupt   x_roott   y_root(   R   R1   R  t   iswin(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRy     s    #
		t   Closes   <<close-window>>c         C   sd   t  |  i d d } x? |  i D]4 \ } } |  i | d  } | i d | d |  q W| |  _ d  S(   Nt   tearoffi    c         S   s   |  i  |  d  S(   N(   t   event_generate(   R*   t	   eventname(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR3     s    R>   R3   (   RR   R*   t   rmenu_specst   add_commandR  (   R   R  R>   R   R3   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    
 c         C   s   t  i |  i d  d  S(   Ns
   About IDLE(   t   aboutDialogt   AboutDialogRV   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRn     s    c         C   s   t  i |  i d  d  S(   Nt   Settings(   t   configDialogt   ConfigDialogRV   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRo     s    c         C   sG   t  i i t  i i t  i i t   d  } t i |  i d |  d  S(   Ns   help.txtt   Help(	   RC   R   RD   t   abspathR   t   __file__t   textViewt	   view_fileRV   (   R   R1   t   fn(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRl     s    -c         C   s<   t  i d  d j o t i |  i  n t i |  i  d S(   Ni   R#   R0   (   RE   RG   RC   t	   startfileRB   t
   webbrowsert   open(   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRm     s    c         C   s   |  i  i d  d S(   Ns   <<Cut>>R0   (   R*   R  (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRh     s    c         C   s,   |  i  i d  p d  S|  i  i d  d S(   NR   s   <<Copy>>R0   (   R*   t
   tag_rangesR  (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRi     s    c         C   s$   |  i  i d  |  i  i d  d S(   Ns	   <<Paste>>R   R0   (   R*   R  R   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRj     s    c         C   s=   |  i  i d d d  |  i  i d d  |  i  i d  d S(   NR   s   1.0s   end-1cR   R0   (   R*   R   R   R   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRq     s    c         C   s*   |  i  i d d d  |  i  i d  d  S(   NR   s   1.0RA   R   (   R*   R   R   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRr     s    c            s:   |  i  i   |  i  i  d       f d   } | S(   s   Cursor move begins at start or end of selection

        When a left/right cursor key is pressed create and return to Tkinter a
        function which causes a cursor move from the associated edge of the
        selection.

        s   sel.first+1cs   sel.last-1cc            sQ   |  i  d @d j o9 y   d   d    WqM t j
 o qM Xn d  S(   Ni   i    s	   sel.firstR   (   R   t   TclError(   R1   (   t   self_text_indext   edges_tablet   self_text_mark_sett
   edge_index(    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   move_at_edge  s    
(   s   sel.first+1cs   sel.last-1c(   R*   R   R   (   R   R6  R7  (    (   R3  R4  R5  R6  s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s
    c         C   s   |  i  i d  d S(   Ns   <Meta-Delete>R0   (   R*   R  (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    c         C   s   |  i  i d  d S(   Ns   <Meta-d>R0   (   R*   R  (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    c         C   s   t  i |  i  d S(   NR0   (   t   SearchDialogt   findR*   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRs     s    c         C   s   t  i |  i  d S(   NR0   (   R8  t
   find_againR*   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRt     s    c         C   s   t  i |  i  d S(   NR0   (   R8  t   find_selectionR*   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRv     s    c         C   s    t  i |  i |  i |  i  d S(   NR0   (   t
   GrepDialogt   grepR*   R   RO   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRu     s    c         C   s   t  i |  i  d S(   NR0   (   t   ReplaceDialogt   replaceR*   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRw     s    c         C   st   |  i  } t i d d d | } | d  j o d S| d j o | i   d S| i d d |  | i d  d  S(   Nt   Gotos   Go to line number:t   parentR0   i    R   s   %d.0(   R*   R   R   R   t   bellR   R   (   R   R1   R*   t   lineno(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRx     s    		
c   	      C   s^  y |  i  i d d  } Wn t j
 o d } n X| i   } t i d d d |  i  d | } | o | i   } n | p d  Sy" t |  \ } } \ } } } Wn; t t f j
 o) } t	 i
 d t |  d |  i  d  SX| t i j o" t	 i
 d	 d
 | d |  i  d  S| o | i   n |  i o |  i i |  n |  i i |  d  S(   Ns	   sel.firsts   sel.lastt    t   ModulesA   Enter the name of a Python module
to search on sys.path and open:RA  t   initialvalues   Import errors   Unsupported types   %s is not a source module(   R*   R   R2  t   stripR   t	   askstringR   t	   NameErrorR   R   R   R   R   R
   R   RO   R0  R   R   (	   R   R1   R&   t   fR   t   suffixt   modeR8   t   msg(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRp   
  s4    	"	
c         C   s   |  i  i } | p+ t i d d d |  i |  i i   d  St i i	 |  \ } } t i i
 |  \ } } d d  k } | i |  i | | g  d  S(   Ns   No filenames&   This buffer has no associated filenamet   masteri(   R   R   R   R   R*   R   R   RC   R   R   t   splitextt   ClassBrowserRO   (   R   R1   R   t   headt   tailt   baset   extRP  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   +  s    
c         C   s    d d  k  } | i  |  i  d  S(   Ni(   t   PathBrowserRO   (   R   R1   RU  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   9  s    c         C   so   | d  j	 o^ | d j oQ |  i i d d |  |  i i d d d  |  i i d d d  |  i   n d  S(   Ni    R   s   %d.0R   s   1.0RA   s
   insert +1l(   R   R*   R   R   R   t   center(   R   RC  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   gotoline=  s
    c         C   s   | p t  i i |  o t St  i i t  i i |   \ } } t  i i |  d j o t Sy& t |  } | i   } | i	   Wn t
 j
 o t SX| i d  o | i d  d j S(   Ns   .pys   .pyws   #!t   pythoni    (   s   .pys   .pyw(   RC   R   RI   t   TrueRO  R   t   normcaseR0  t   readlineR   t   IOErrorR   t
   startswithR9  (   R   R   RS  RT  RJ  R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   D  s    $c         C   s+   |  i  o |  i  i |   d  |  _  n d  S(   N(   RO   t   unregister_maybe_terminateR   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt
   close_hookR  s    
c         C   s   | |  _  d  S(   N(   R_  (   R   R_  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   set_close_hookW  s    c         C   sF   |  i  o |  i  i |   n |  i   |  i i |   |  i   d  S(   N(   RO   t   filename_changed_editR   RV   t   update_windowlist_registryR   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   Z  s
    

c         C   s   |  i  o d  S|  i |  i i  o |  i   |  _  n |  i  o= |  i i |  i  |  i i |  i   |  i i |  i  n d  S(   N(	   R   R   R   R   R   R   t   removefilterR   R   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   _addcolorizera  s    

c         C   s<   |  i  p d  S|  i  i   |  i i |  i   d  |  _  d  S(   N(   R   t   removecolorsR   Rc  R   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   _rmcolorizerl  s
    
c         C   s   |  i    |  i   t i d d d  } t i | d  } t i | d d d } t i | d  } |  i i d	 | d	 d
 | d
 d | d | d	 d | d
  d S(   s   Update the colour themeR(   t   ThemeR&   R7   R  t   fgBgt   fgt   hilitet
   foregroundt
   backgroundt   insertbackgroundt   selectforegroundt   selectbackgroundN(   Rf  Rd  R   R`   t   GetHighlightR*   R   (   R   t   themet   normal_colorst   cursor_colort   select_colors(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   s  s    




c         C   sj   d } t  i d d d d d o
 d } n |  i i d t  i d d d  t  i d d d	  | f  d
 S(   s.   Update the text widgets' font if it is changedR7   R(   R   s	   font-boldR8   R9   R:   R;   s	   font-sizeN(   R   R`   R*   R   (   R   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt	   ResetFont  s    
c         C   s   t  i   |  i _ } x- | i   D] \ } } |  i i | |  q# Wx^ |  i   D]P } t  i |  } | o4 x1 | i   D] \ } } |  i i | |  q| WqS qS Wd S(   s/   Remove the keybindings before they are changed.N(	   R   t   GetCurrentKeySett   Bindingst   default_keydefst   itemsR*   t   event_deletet   get_standard_extension_namest   GetExtensionBindings(   R   t   keydefsR1   t   keylistt   extensionNamet   xkeydefs(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   RemoveKeybindings  s       c      
   C   s  t  i   |  i _ } |  i   x; |  i   D]- } t  i |  } | o |  i |  q- q- Wh  } xf |  i i D]X } h  | | d <xA | d D]5 } | o( | d | | d t | d  d <q q Wqq Wx|  i	 i
   D] } |  i	 | } | i t  d } x t d |  D] }	 | i |	  d j o | i |	 d  }
 |
 o | i |	 d  } d } | i |  o* | | i |  o | | | } qn | o& t | |  }
 | i |	 d |
 qqqqWq Wd S(   s-   Update the keybindings after they are changedi    i   R3   t   acceleratorR>   RD  N(   R   Rv  Rw  Rx  Rd   R{  R|  t   menudefsR  R   t   keysR   R  t   rangeR8   t	   entrycgett   has_keyt   get_acceleratort   entryconfig(   R   R}  R  R  t   menuEventDictR%   t   itemt   menubarItemRA   R   t   accelt   itemNameR1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   ApplyKeybindings  s@    
   0  c         C   s0   |  i  p" t i d d d d d |  _ n d S(   sC   Update the indentwidth if changed and not using tabs in this windowR(   R=   s
   num-spacesR8   R   N(   R   R   R`   R   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    
c         C   s   t  i   } |  i d } | i t  } | |  i j o | i |  i d |  n | oL | i   x? | D]3 } |  i | d  } | i	 d | d d |  qk Wn | |  i d <d S(   s3   Update the additional help entries on the Help menuR  i   R>   i    R3   N(
   R   t   GetAllExtraHelpSourcesListR   R   R  R  R  R   t"   _EditorWindow__extra_help_callbackR"  (   R   t	   help_listt   helpmenut   helpmenu_lengtht   entryt   cmd(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    
 "c         C   s   | d  } | S(   sC   Create a callback with the helpfile value frozen at definition timec         S   s\   |  i  d  p t i i |   } n t i d  d j o t i |   n t i |   d  S(   Nt   wwwt   httpi   R#   (   R  R  (	   R]  RC   R   RM   RE   RG   R.  R/  R0  (   t   helpfilet   url(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   display_extra_help  s
    (    (   R   R  R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   __extra_help_callback  s    c         C   s  g  } t  i i |  i  o4 t |  i d  } z | i   } Wd | i   Xn | oH t  i i |  d } | | j o | i |  n | i	 d |  n g  } xG | D]? } d | j p t  i i | d d ! o | i
 |  q q Wg  } | D] } | | j o | | q q ~ } d } | d t |  !} t |  i d  } z | i |  Wd | i   Xx |  i i i   D] }	 |	 i }
 |
 i d	 t  xs t t   |  D]_ \ } } | d d !} |  i |  } |	 i |  } |
 i d
 | | d | d | d d  qWq~Wd S(   s/   Load and update the recent files list and menust   rNs   
i    t    it   1234567890ABCDEFGHIJKt   wi   R>   R   R3   R?   (   RC   R   R   R\   R0  t	   readlinesR   R)  t   removeR   t   appendR   t
   writelinesRV   RZ   R  R   R  R  t   zipR    R   t#   _EditorWindow__recent_file_callbackR"  (   R   t   new_filet   rf_listt   rf_list_filet	   bad_pathsR   t   _[1]t   ulcharst   rf_filet   instanceR%   t   iR   t	   file_namet
   ufile_namet   callback(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     sF     (2 	 c            s   |   f d  } | S(   Nc            s     i  i d |   d  S(   Nt   editFile(   R   R0  (   t
   fn_closure(   R   (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   open_recent_file  s    (    (   R   R  R  (    (   R   s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   __recent_file_callback  s    c         C   s   |  i    } |  i   } | o | o | d | } n) | o
 | } n | o
 | } n d } | p | p | } |  i   p d | } d | } n |  i i |  |  i i |  d  S(   Ns    - t   Untitleds   *%s*s   *%s(   t   short_titlet
   long_titlet	   get_savedRV   t   wm_titlet   wm_iconname(   R   t   shortt   longt   titlet   icon(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   
  s    


c         C   s   |  i  i   S(   N(   R   R  (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    c         C   s   |  i  i |  d  S(   N(   R   t	   set_saved(   R   t   flag(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    c         C   s   |  i  i   d  S(   N(   R   t
   reset_undo(   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  "  s    c         C   s6   |  i  i } | o t i i |  } n |  i |  S(   N(   R   R   RC   R   R   R   (   R   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  %  s    c         C   s   |  i  |  i i p d  S(   NRD  (   R   R   R   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  ,  s    c         C   s   |  i    d  S(   N(   RV  (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRk   0  s    R   c         C   sb   |  i  } |  i   \ } } |  i |  } | | } t d | | d  } | i t |   d  S(   Ni   i   (   R*   t   getwindowlinest	   getlinenot   maxR   t   float(   R   t   markR*   RV   t   botRC  R.   t   newtop(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRV  3  s    	
c         C   ss   |  i  } |  i d  } |  i d  } | | j o5 | i   d j o" t | d  } | | d } n | | f S(   Ns   @0,0s   @0,65535i   R.   (   R*   R  t   winfo_heightR   (   R   R*   RV   R  R.   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  ;  s    	 c         C   s"   |  i  } t t | i |    S(   N(   R*   R   R  R   (   R   R  R*   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  E  s    	c         C   s:   |  i  i   } t i d |  } t t | i    } | S(   s   Return (width, height, x, y)s   (\d+)x(\d+)\+(-?\d+)\+(-?\d+)(   RV   t   wm_geometryt   ret   matcht   mapR   t   groups(   R   t   geomt   mt   tuple(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   get_geometryI  s    c         C   s   |  i    d  S(   N(   R   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRg   P  s    c         C   sn   |  i  o` |  i   pE |  i i   d j o |  i i   n |  i i   |  i i   n |  i  i   Sd  S(   NR7   (   R   R  RV   R   t	   deiconifyt   lowert   liftt	   maybesave(   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  S  s    
c         C   s1   |  i    } t |  d j o |  i   n | S(   Nt   cancel(   R  R   t   _close(   R   t   reply(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   \  s    c         C   s   |  i  i o |  i d |  i  i  n t i |  i  |  i   |  i  i   d  |  _  d  |  _	 |  i
 o |  i
 i t  d  |  _
 n d  |  _ d  |  _ |  i i   d  |  _ |  i i   |  i o |  i   n d  S(   NR  (   R   R   R   RT   t   unregister_callbackR   t   unload_extensionsR   R   R   R   R   R*   RX   R   RV   t   destroyR_  (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  b  s"    
		
			
c         C   s   h  |  _  |  i   d  S(   N(   t
   extensionst   load_standard_extensions(   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   v  s    	c         C   sE   x5 |  i  i   D]$ } t | d  o | i   q q Wh  |  _  d  S(   NR   (   R  t   valuest   hasattrR   (   R   t   ins(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR  z  s
     c         C   s[   xT |  i    D]F } y |  i |  Wq d Gt |  GHd d  k } | i   q Xq Wd  S(   Ns   Failed to load extensioni(   R{  t   load_extensiont   reprt	   tracebackt	   print_exc(   R   R&   R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s     c         C   s   t  i d t  S(   Nt   editor_only(   R   t   GetExtensionsRY  (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR{    s    c         C   sb  y t  | t   t   g   } Wn t j
 o d G| GHd  SXt | |  } t i |  } t | d  o |  i | i	 |  n | |   } | |  i
 | <| o |  i |  x | i   D] } | i d d  } x  | d  d j o | d } q Wx  | d d j o | d  } q W| d	 } t | |  o  |  i i | t | |   q q Wn d  S(
   Ns   
Failed to import extension: R  t   -t   _i   t   <iR   t   _event(   t
   __import__t   globalst   localsR   t   getattrR   R|  R  R  R  R  Rd   R  R?  R*   Rf   (   R   R&   t   modt   clsR}  R  t   veventt
   methodname(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s2    	   
c         C   sk   | d  j o |  i i } n |  i } | | _ x5 | i   D]' \ } } | o | i | |  q< q< Wd  S(   N(   R   Rw  Rx  R*   R}  Ry  R   (   R   R}  R*   R1   R~  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRd     s    		 c         C   sr  | d	 j o |  i i } n | d	 j o |  i i } n |  i } |  i } x| D]\ } } | i |  } | p qS n x | D] } | p | i   q | \ }	 }
 |	 d  d j } | o |	 d }	 n t |	  \ } }	 t	 | |
  } | |
 d  } | o> |  i
 |
 t  } | i d |	 d | d | d | d |  q | i d |	 d | d | d |  q WqS Wd	 S(
   s   Add appropriate entries to the menus and submenus

        Menus that are absent or None in self.menudict are ignored.
        i   t   !c         S   s   |  i  |  d  S(   N(   R  (   R*   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR3     s    R>   R?   R3   R  t   variableN(   R   Rw  R  Rx  R   R*   R   R   R  R  t   get_var_objt
   BooleanVart   add_checkbuttonR"  (   R   R  R}  R   R*   t   mnamet	   entrylistR%   R  R>   R   t   checkbuttonR?   R  R3   t   var(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s<    		  c         C   s4   |  i  |  } | o | i   } | St |  d  S(   N(   R  R   RI  (   R   R&   R  t   value(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   getvar  s
    c         C   s7   |  i  | |  } | o | i |  n
 t |  d  S(   N(   R  R   RI  (   R   R&   R  t   vartypeR  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   setvar  s    c         C   sC   |  i  i |  } | o% | o | |  i  |  i  | <} n | S(   N(   RX   R   R*   (   R   R&   R  R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    c         C   s?   |  i  o- |  i i d |  p d |  i i |  j Sd Sd  S(   Nt   TODOt   STRINGi   (   R   R*   t   tag_prevranget	   tag_names(   R   t
   text_index(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   is_char_in_string  s    
c         C   sM   y2 |  i  i d  } |  i  i d  } | | f SWn t j
 o d SXd  S(   Ns	   sel.firsts   sel.last(   NN(   R*   R   R2  R   (   R   R   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   get_selection_indices  s    c         C   s   |  i  d p t } t |  S(   Nt   tabs(   R*   t   TK_TABWIDTH_DEFAULTR   (   R   t   current(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   get_tabwidth  s    c         C   s`   |  i  } |  i   | j o@ | i i d d | d d | i d |  } | i d |  n d  S(   NR;   t   measures
   -displayoft   nR
  (   R*   R  t   tkt   callRN  t	   configure(   R   t   newtabwidthR*   t   pixels(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   set_tabwidth  s    		c         C   s}   | ob | o[ |  i    } d | j o
 d j n o | |  _ n |  i |  i j o t |  _ qi n |  i |  i  d  S(   Ni   i   (   t   guess_indentR   R   R   R   R  (   R   R   t   guessR  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    c         C   s  |  i  } |  i   \ } } | o, | o% | i | |  | i d |  d S| i d d  } | d j o6 | i d d d  o | i d  n | i   d S| d d	 j o | i d  d S|  i } t | i	 |   } | d
 |  i
 |  i
 } t i i d  d }	 d }
 xa | |	 j o Pn | d  } |
 d
 }
 t | i	 |   } | | j p | d d	 j o Pqq| i   | i d |
 d  | | j  o | i d d | |  n | i   d S(   NR   R0   s   insert linestartRD  R   s   1.0s	   insert-1cis    	i   s   
i    s
   insert-%dcR   (   R*   R	  R  R   R   R   RB  R   R   t
   expandtabsR   RE   RQ   R   R   R   R   (   R   R1   R*   R   R   t   charsR   t   havet   wantt   last_line_of_promptt   ncharsdeleted(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRz   %  sD    	
	



c   
      C   sQ  |  i  } |  i   \ } } | i   z| oR | oK t |  t |  j o |  i |  S| i | |  | i d |  n | i d d  } t | |  i	  \ } } | t
 |  j o |  i | |  i  nX |  i o
 d } n4 t
 | i |  i	   } |  i }	 d |	 | |	 } | i d |  | i d  d SWd  | i   Xd  S(   NR   s   insert linestarts   	R   R0   (   R*   R	  R   t
   index2lineR}   R  R   R   t
   classifywsR   R   t   reindent_toR   R   R  R   R   R   (
   R   R1   R*   R   R   RF   t   rawt	   effectivet   padR  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR|   R  s,    	


	c      	   C   s  |  i  } |  i   \ } } | i   z| o+ | o$ | i | |  | i d |  n | i d d  } d t |  } } x- | | j  o | | d j o | d } q W| | j o | i d d  d S| |  } d } t i	 i
 d  d }	 x> | o6 | d d j o% | |	 j o | d  } | d } q W| o | i d	 | d  n x( | i d  d j o | i d  qZW| i d d  t | i d   }
 t i |  i |  i  } |  i p x |  i D] } t |
 | d  } | d
 } | i | d  } | i |  | i |  i |  i |   } | d  j	 p | d j o PqqW| i | p d  nZ | i d d  } | o | d } n d } | i | d  } | i |  | i d  | i   } | t i j o | t i j o n | t i j o | i d |  nv | t i j o |  i | i     nO | t i! j o> | i"   d j o | i d |  q|  i | i#    n d S| i$   } | i d |  | i%   o |  i& |  n& | o | i'   o |  i( |  n d SWd  | i) d  | i*   Xd  S(   NR   s   insert linestarti    s    	i   s   
R0   is   insert - %d charss   .0t   consoles   1.0(+   R*   R	  R   R  R   R   R   R   RE   RQ   R   R  R   t   PyParset   ParserR   R   R   R   R  t   set_strt   find_good_parse_startt   _build_char_in_string_funcR   t   set_loR  t   get_continuation_typet   C_NONEt   C_STRING_FIRST_LINEt   C_STRING_NEXT_LINESt	   C_BRACKETR   t   compute_bracket_indentt   C_BACKSLASHt   get_num_lines_in_stmtt   compute_backslash_indentt   get_base_indent_stringt   is_block_openerR|   t   is_block_closerRz   R   R   (   R   R1   R*   R   R   R   R  R  t   indentR  t   lnoR  t   contextt   startatt   startatindext   rawtextt   bodR  R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR{   u  s    	
 
 %
 

 	c         C   s   | |  i  d  } | S(   Nc         S   s   | | d |   S(   Ns   +%dc(    (   t   offsett   _startindext   _icis(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   inner  s    (   R  (   R   t
   startindexRA  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR)    s    c   
      C   s   |  i    \ } } } } xo t t |   D][ } | | } | oD t | |  i  \ } }	 |	 |  i }	 |  i |	  | | | | <q+ q+ W|  i | | | |  d S(   NR0   (   t
   get_regionR  R   R  R   R   t   _make_blankst
   set_region(
   R   R1   RQ  RR  R  t   linest   posR   R!  R"  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR}     s     
#c   
      C   s   |  i    \ } } } } xx t t |   D]d } | | } | oM t | |  i  \ } }	 t |	 |  i d  }	 |  i |	  | | | | <q+ q+ W|  i | | | |  d S(   Ni    R0   (	   RC  R  R   R  R   R  R   RD  RE  (
   R   R1   RQ  RR  R  RF  RG  R   R!  R"  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR~     s     
#c         C   sk   |  i    \ } } } } x6 t t |  d  D] } | | } d | | | <q/ W|  i | | | |  d  S(   Ni   s   ##(   RC  R  R   RE  (   R   R1   RQ  RR  R  RF  RG  R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s     
c         C   s   |  i    \ } } } } xz t t |   D]f } | | } | p q+ n | d  d j o | d } n  | d  d j o | d } n | | | <q+ W|  i | | | |  d  S(   Ni   s   ##i   t   #(   RC  R  R   RE  (   R   R1   RQ  RR  R  RF  RG  R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s     
c         C   s   |  i    \ } } } } |  i   } xw t t |   D]c } | | } | oL t | |  \ }	 }
 t |
 |  \ } } d | d | | |	 | | <q7 q7 W|  i | | | |  d  S(   Ns   	R   (   RC  t   _asktabwidthR  R   R  t   divmodRE  (   R   R1   RQ  RR  R  RF  R   RG  R   R!  R"  t   ntabst   nspaces(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s     
&c         C   sr   |  i    \ } } } } |  i   } x1 t t |   D] } | | i |  | | <q7 W|  i | | | |  d  S(   N(   RC  RI  R  R   R  RE  (   R   R1   RQ  RR  R  RF  R   RG  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s     c         C   s\   |  i  d d d |  i d d |  i d d	 d
 |  i o |  i |  _ d |  _ n d S(   Ns   Toggle tabss
   Turn tabs t   ont   offs   ?
Indent width s   will bes
   remains ats    8.s!   
 Note: a tab is always 8 columnsRA  i   R0   (   s   ons   off(   s   will bes
   remains at(   R   R   R*   R   (   R   R1   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   "  s    !c         C   sc   |  i  d d d |  i d |  i d d d d } | o( | |  i j o |  i o | |  _ n d	 S(
   Ns   Indent widths6   New indent width (2-16)
(Always use 8 when using tabs)RA  RF  t   minvaluei   t   maxvaluei   R0   (   R   R*   R   R   (   R   R1   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   8  s    			"c         C   s   |  i  } |  i   \ } } | o1 | o* | i | d  } | i | d  } n | i d  } | i d  } | i | |  } | i d  } | | | | f S(   Ns
    linestarts   -1c lineend +1cs   insert linestarts   insert lineend +1cs   
(   R*   R	  R   R   R   (   R   R*   R   R   RQ  RR  R  RF  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRC  D  s    	c         C   s   |  i  } d i |  } | | j o | i   d  S| i d d d  | i d |  | i   | i | |  | i | |  | i   | i	 d | d  d  S(   Ns   
R   s   1.0RA   R   (
   R*   RD   RB  R   R   R   R  R   R   R   (   R   RQ  RR  R  RF  R*   t   newchars(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRE  Q  s    	


c         C   s?   |  i  o) t | |  i  \ } } d | d | Sd | Sd  S(   Ns   	R   (   R   RJ  R   (   R   R  RK  RL  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRD  a  s    
c         C   so   |  i  } | i   | i d d d  o | i d d  n | o | i d |  i |   n | i   d  S(   Ns   insert linestarts   !=R   (   R*   R   R   R  R   RD  R   (   R   R   R*   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   k  s    	
c         C   s8   |  i  d d d |  i d |  i d d d d p |  i S(	   Ns	   Tab widths   Columns per tab? (2-16)RA  RF  RO  i   RP  i   (   R   R*   R   R   (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRI  t  s    		c         C   su   t  |  i |  i  i   \ } } | o; | o4 t | |  i  \ } } t | |  i  \ } } n d } } | | S(   Ni    (   t   IndentSearcherR*   R   R   R  (   R   t   openert   indentedR!  t   indentsmallt   indentlarge(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    !
(   s   fileR   (   s   editR   (   s   formatR   (   s   runR   (   R   R   (   s   windowsR   (   s   helpR  (   s   windowsR  (   R  s   <<close-window>>(s   R   t
   __module__R   R   R   R   R   R   Rw  t   TkinterR   R    R   RB   R   R   R   R   R   R   R  RK   RL   Rc   R   R  Ry   R!  R  Rn   Ro   Rl   Rm   Rh   Ri   Rj   Rq   Rr   R   R   R   Rs   Rt   Rv   Ru   Rw   Rx   Rp   R   R   RW  R   R_  R`  R   Rd  Rf  R   Ru  R  R  R   R  R  R   R  R   R  R  R  R  R  Rk   RV  R  R  R  Rg   R  R   R  R   R  R  R{  R  Rd   R  R   R  R  R  R	  R  R  RY  R   Rz   R|   R{   R)  R}   R~   R   R   R   R   R   R   RC  RE  RD  R   RI  R  (    (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR   *   s   			,				
															!									
		 			(									
													%							-	#	k												
			c         C   s   t  t |    S(   N(   R   R  (   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    c         C   sx   d } } xa |  D]Y } | d j o | d } | d } q | d j o  | d } | | d | } q Pq W| | f S(   Ni    R   i   s   	(    (   t   sR   R!  R"  t   ch(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    
 

RR  c           B   s;   e  Z d    Z d   Z e i e i d
 d  Z d	   Z RS(   c         C   s6   | |  _  | |  _ d |  _ |  _ d  |  _ |  _ d  S(   Ni    (   R*   R   R  t   finishedR   t   blkopenlinet   indentedline(   R   R*   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    		c         C   sh   |  i  o d S|  i d } |  _ t |  d } |  i i | d d  o d S|  i i | | d  S(   NRD  i   s   .0s   >=RA   s    lineend+1c(   R[  R  R  R*   R   R   (   R   R  R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR[    s    
t   classt   deft   fort   ift   tryt   whilec	   	      C   sf   |  i  o nU | | j o | | j o | |  _ n. | | j o  |  i o | |  _ d |  _  n d  S(   Ni   (   R[  R\  R]  (	   R   R8   t   tokent   startRA   R   t   INDENTt   NAMEt   OPENERS(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt
   tokeneater  s    
	c      	   C   si   t  i } |  i t  _ z7 y t  i |  i |  i  Wn t  i j
 o n XWd  | t  _ X|  i |  i f S(   N(	   t	   _tokenizet   tabsizeR   t   tokenizeR[  Ri  t
   TokenErrorR\  R]  (   R   t   save_tabsize(    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR     s    		
(   R^  R_  R`  Ra  Rb  Rc  (	   R   RW  R   R[  Rj  Rf  Rg  Ri  R   (    (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyRR    s   		
	c         C   s@   |  i  d  } | d j o |  |  |  | d }  n | |  f S(   NR  i    i   (   R9  (   RY  R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    t   [t   bracketleftt   ]t   bracketrightt   /t   slashc         C   s   |  i  |  } | p d S| d } t i d d   |  } t i d d   |  } t i d d |  } t i d d	 |  } t i d
 d |  } t i d d |  } t i d d |  } t i d d |  } t i d d |  } | S(   NRD  i    s   -[a-z]\bc         S   s   |  i    i   S(    (   t   groupt   upper(   R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR2     s    s   \b\w+\bc         S   s   t  i |  i   |  i    S(    (   t   keynamesR   Ru  (   R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR2     s    s   Key-t   Cancels
   Ctrl-Breaks   Control-s   Ctrl-R  t   +s   ><R   R  R   (   R   R  t   sub(   R}  R   R~  RY  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyR    s    
c         C   sF   |  i  } | i d d d  | i d d d  | i d d d  d  S(	   Nt   tcl_wordBreakAfters   a bi    R   t   tcl_wordcharss   [a-zA-Z0-9_]t   tcl_nonwordcharss   [^a-zA-Z0-9_](   R  R  (   RP   R  (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   fixwordbreaks  s    	c          C   s   t    }  t |   |  i   t i d o t i d } n d  } t d |  d |  } | i |  i  | i	 i
 d | i  |  i   |  i   d  S(   Ni   RP   R   s   <<close-all-windows>>(   t   TkR~  t   withdrawRE   t   argvR   R   R`  t   quitR*   Rf   Rg   t   mainloopR  (   RP   R   R   (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   test   s    	


t   __main__((   RE   RC   R  R   t	   itertoolsR    RX  R   R   t	   MultiCallR   R/  t   idleverRT   R8  R<  R>  R%  t   configHandlerR   R#  R+  R&  RK   R  R   R   t   objectR   R  R  Rl  Rj  RR  R  Rw  R  R~  R  R   (    (    (    s1   /mit/python/lib/python2.6/idlelib/EditorWindow.pyt   <module>   sT   
$     g		2		
				