
\Kc           @   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 <d d <d d <Z# 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(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   _find_module   s     t   EditorWindowc           B   se  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 d  Z dz 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& d/   Z' d0   Z( d1   Z) d2   Z* d3   Z+ d4   Z, d5   Z- d d6  Z. d d7  Z/ d d8  Z0 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> d dG  Z? dH   Z@ dI   ZA dJ   ZB dK   ZC dL   ZD dM   ZE dN   ZF dO   ZG dP dQ  ZH dR   ZI dP dS  ZJ dT   ZK dU   ZL dV   ZM dW   ZN dX   ZO dY   ZP dZ   ZQ d[   ZR d\   ZS d]   ZT d d^  ZU d d d_  ZV d`   ZW d da  ZX d db  ZY dc   ZZ dd   Z[ de   Z\ df   Z] e^ dg  Z_ 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 RS(   i(   t
   Percolator(   t   ColorDelegator(   t   UndoDelegator(   t	   IOBindingt   filesystemencodingt   encodingN(   t   Toplevel(   t   MultiStatusBarc         C   sB
  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! |
 d d |  _" } t# |
  |  _$ } t i% d d d  |  _& t' t(  | d d d d d d d t i) |	 d d  d! d" t i) |	 d d  d# d$ t i) |	 d% d  d! d& t i) |	 d% d  d# d' t i) |	 d( d  d! d |  i& d) t i% d d d)  
|  _* } |  i* |  i _+ |  i,   |  i-   |  i i. d* |  i/  |  i i0 d+ |  i1  t i   o | i0 d+ |  i1  n | i0 d, |  i2  | i0 d- |  i3  | i0 d. |  i4  | i0 d/ |  i5  | i0 d0 |  i6  | i0 d1 |  i7  | i0 d2 |  i8  | i0 d3 |  i9  | i0 d4 |  i:  | i0 d5 d6    | i0 d7 |  i;  | i0 d8 |  i<  | i0 d9 |  i=  | i0 d: |  i>  | i0 d; |  i?  | i0 d< |  i@  | i0 d= |  iA  | i0 d> |  iB  | i0 d? |  iC  | i0 d@ |  iD  | i0 dA |  iE  | i0 dB |  iF  | i0 dC |  iG  | i0 dD |  iH  | i0 dE |  iI  | i0 dF |  iJ  | i0 dG |  iK  | i0 dH |  iL  | i0 dI |  iM  | i0 dJ |  iN  | i0 dK |  iO dL   | i0 dM |  iO dN   | i0 dO |  iP  | i0 dP |  iQ  | ox | | i |  <| o |  | iR | <n | i0 dQ |  iS  | i0 dR |  i iT  | i0 dS |  iU  | i0 dT |  iV  n |  iW   | iX | dU <| iY dV tZ dW t[  | i\ | dX <d } t i% d d dY dZ d[ o
 d\ } n | i] d] t i% d d d]  t i% d d d^  | f  | iY dV t^ dW t_ d_ dN  | iY dV t` dW t_ d_ dN  | ia   t i% d d` da dZ d[ } | |  _b db |  _c |  ic |  _d |  ie   tf |  _g dm |  _h |  ii |  |  _j } |  ik |  o$ |  il   |  _m } | in |  n
 d  |  _m |  io   |  _p } | in |  | iq | _q | ir | _r | is |  it  |  iu |   |  _v } | iw |  ix  t |  i  |  _y |  iz df i{ d dg dh di dL d |  iy |  i|   | oI t i i} |  o% t i i |  o | i~ |  qo	| i |  n |  it   |  i |  ik |   |  i   |  iz i dj  } | oh | i dk  } | d  j o
 dl } n | dL j o | i   | dN } n | |  _ t i |  i  n t i |  _ t i |  _ t i |  _ d  S(n   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
   foregroundt   normalt   fgBgt   fgt
   backgroundt   bgt   highlightcolort   hilitet   highlightbackgroundt   insertbackgroundt   cursort   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(    (    s*   /usr/lib/python2.5/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   <<open-new-window>>s   <<close-all-windows>>s   <<open-class-browser>>s   <<open-path-browser>>t   commandt   sidet   fillt   yscrollcommands	   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	   ScrollbarR'   t   Framet
   text_framet	   GetOptionR)   R   t   Textt   GetHighlightR*   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   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   pert   ispythonsourceR   t   colort   insertfilterR   t   undot   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   existst   loadfilet   set_filenamet   set_indentation_paramst   load_extensionst   gett   indext   add_separatort	   wmenu_endt   register_callbackt   postwindowsmenut   tkMessageBoxt   askyesnot   tkSimpleDialogt
   askintegert	   showerror(   t   selfRY   R   t   keyRZ   t   dochomet   pyvert   basepatht   chmfilet   currentThemeR`   R'   Ri   R*   t
   fontWeightt	   usespacesR   R   R   R   R%   RK   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   __init__5   sF   
											






	
			

'



	c         C   s   t  | t  p | o | Snb y | i |  i  SWnJ t j
 o> y | i |  i  SWq t j
 o | i d  Sq 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   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   _filename_to_unicode  s    c         C   s)   |  i  i   \ } } |  i i |  d S(   NR;   (   R   t   defaultfilenameRY   t   new(   R   R<   t   dirnamet   basename(    (    s*   /usr/lib/python2.5/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       R?   t   columns   Col: ?t   lines   Ln: ?R@   s   <<set-line-and-column>>s   <KeyRelease>s   <ButtonRelease>(   R    R`   t
   status_barRU   RV   t	   set_labelR   R   t   BOTTOMt   XR*   Rq   t   set_line_and_columnt	   event_addt
   after_idle(   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   )  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   R<   R   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   7  s    !R   t   _Filet   editt   _Editt   formatt   F_ormatt   runt   _Runt   optionst   _OptionsRJ   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&   RH   R%   RI   R$   s
   .frameworkt   applet   applicationt   IDLER   (   R]   R   t
   menu_specst   prepstrR\   t   add_cascadeRO   RQ   t
   executablet
   fill_menusR   t   ENDt   base_helpmenu_lengtht   reset_help_menu_entries(   R   t   mbarR   R&   RH   RI   R%   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRn   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(   NRJ   RK   ii   (   R   R   R   R   t   deleteR^   t   add_windows_to_menu(   R   R%   RK   (    (    s*   /usr/lib/python2.5/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(   Nt   sels   1.0RK   t   inserts   @%d,%di   R#   R8   t   arrowt   ibeam(   R*   t
   tag_removet   mark_sett   xt   yt   rmenut
   make_rmenuR<   RO   RQ   R   t   tk_popupt   x_roott   y_root(   R   R<   R  t   iswin(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   h  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(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR>   ~  s    RH   R>   (   R\   R*   t   rmenu_specst   add_commandR  (   R   R  RH   R  R>   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  {  s    
 c         C   s   t  i |  i d  d  S(   Ns
   About IDLE(   t   aboutDialogt   AboutDialogR`   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRy     s    c         C   s   t  i |  i d  d  S(   Nt   Settings(   t   configDialogt   ConfigDialogR`   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRz     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(	   RM   R   RN   t   abspathR   t   __file__t   textViewt
   TextViewerR`   (   R   R<   t   fn(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRw     s    -c         C   s<   t  i d  d j o t i |  i  n t i |  i  d S(   Ni   R#   R;   (   RO   RQ   RM   t	   startfileRL   t
   webbrowsert   open(   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRx     s    c         C   s   |  i  i d  d S(   Ns   <<Cut>>R;   (   R*   R  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRs     s    c         C   s/   |  i  i d  p d  Sn |  i  i d  d S(   NR  s   <<Copy>>R;   (   R*   t
   tag_rangesR  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRt     s    c         C   s   |  i  i d  d S(   Ns	   <<Paste>>R;   (   R*   R  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRu     s    c         C   s=   |  i  i d d d  |  i  i d d  |  i  i d  d S(   NR  s   1.0s   end-1cR  R;   (   R*   t   tag_addR  t   see(   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR|     s    c         C   s*   |  i  i d d d  |  i  i d  d  S(   NR  s   1.0RK   R  (   R*   R  R'  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR}     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  (   t   statet   TclError(   R<   (   t   self_text_indext   edges_tablet   self_text_mark_sett
   edge_index(    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   move_at_edge  s    
(   s   sel.first+1cs   sel.last-1c(   R*   R   R  (   R   R-  R.  (    (   R*  R+  R,  R-  s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s
    c         C   s   |  i  i d  d S(   Ns   <Meta-Delete>R;   (   R*   R  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   s   |  i  i d  d S(   Ns   <Meta-d>R;   (   R*   R  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   s   t  i |  i  d S(   NR;   (   t   SearchDialogt   findR*   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR~     s    c         C   s   t  i |  i  d S(   NR;   (   R/  t
   find_againR*   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   s   t  i |  i  d S(   NR;   (   R/  t   find_selectionR*   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   s    t  i |  i |  i |  i  d S(   NR;   (   t
   GrepDialogt   grepR*   R   RY   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   s   t  i |  i  d S(   NR;   (   t   ReplaceDialogt   replaceR*   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   sz   |  i  } t i d d d | } | d  j o d Sn | d j o | i   d Sn | i d d |  | i d  d  S(   Nt   Gotos   Go to line number:t   parentR;   i    R  s   %d.0(   R*   R   R   R   t   bellR  R'  (   R   R<   R*   t   lineno(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    		
c   	      C   sg  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  Sn y" t |  \ } } \ } } } Wn> t t f j
 o, } t	 i
 d t |  d |  i  d  Sn X| t i j o% t	 i
 d	 d
 | d |  i  d  Sn | 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:R8  t   initialvalues   Import errors   Unsupported types   %s is not a source module(   R*   R   R)  t   stripR   t	   askstringR   t	   NameErrorR   R   R   t   strR   R
   R   RY   R$  R   R   (	   R   R<   R&   t   fR   t   suffixt   modeRB   t   msg(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR{     s4    	"		
c         C   s   |  i  i } | p. t i d d d |  i |  i i   d  Sn 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   RM   R   R   t   splitextt   ClassBrowserRY   (   R   R<   R   t   headt   tailt   baset   extRH  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   
  s    
c         C   s    d d  k  } | i  |  i  d  S(   Ni(   t   PathBrowserRY   (   R   R<   RM  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     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.0RK   s
   insert +1l(   R   R*   R  R  R&  t   center(   R   R:  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   gotoline  s
    c         C   s   | p t  i i |  o t Sn t  i i t  i i |   \ } } t  i i |  d j o t Sn y& t |  } | i   } | i	   Wn t
 j
 o t Sn X| i d  o | i d  d j S(   Ns   .pys   .pyws   #!t   pythoni    (   s   .pys   .pyw(   RM   R   RS   t   TrueRG  R   t   normcaseR$  t   readlineR   t   IOErrorR   t
   startswithR0  (   R   R   RK  RL  RB  R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   #  s    $	c         C   s"   |  i  o |  i  i |   n d  S(   N(   RY   t
   close_edit(   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt
   close_hook1  s    
c         C   s   | |  _  d  S(   N(   RW  (   R   RW  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   set_close_hook5  s    c         C   sj   |  i  o |  i  i |   n |  i   |  i i |   |  i |  i i  o |  i   n |  i	   d  S(   N(
   RY   t   filename_changed_editR   R`   t   update_windowlist_registryR   R   R   t   addcolorizert   rmcolorizer(   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   8  s    

c         C   s^   |  i  o d  Sn |  i i |  i  |  i   |  _  |  i i |  i   |  i i |  i  d  S(   N(   R   R   t   removefilterR   R   R   (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR[  B  s    
c         C   se   |  i  p d  Sn |  i  i   |  i i |  i  |  i i |  i   d  |  _  |  i i |  i  d  S(   N(   R   t   removecolorsR   R]  R   R   R   (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR\  J  s    
	c         C   se   |  i  o& |  i   |  _  |  i i |  i   n t i d d d  } |  i i t i | d   d S(   s(   Update the colour theme if it is changedR(   t   ThemeR&   R/   N(	   R   R   R   R   R   Rj   R*   R   Rl   (   R   t   theme(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   ResetColorizerS  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 changedR/   R(   R   s	   font-boldRB   RC   RD   RE   s	   font-sizeN(   R   Rj   R*   R   (   R   R   (    (    s*   /usr/lib/python2.5/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   keydefsR<   t   keylistt   extensionNamet   xkeydefs(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   RemoveKeybindingsf  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   R>   t   acceleratorRH   R;  N(   R   Rc  Rd  Re  Ro   Rh  Ri  t   menudefsR   R   t   keysR   R   t   rangeRB   t	   entrycgett   has_keyt   get_acceleratort   entryconfig(   R   Rj  Rl  Rm  t   menuEventDictR%   t   itemt   menubarItemRK   R   t   accelt   itemNameR<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   ApplyKeybindingsr  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(   RG   s
   num-spacesRB   t   intN(   R   R   Rj   R   (   R   (    (    s*   /usr/lib/python2.5/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   RH   i    R>   N(
   R   t   GetAllExtraHelpSourcesListR   R   R   R   R  R   t"   _EditorWindow__extra_help_callbackR  (   R   t	   help_listt   helpmenut   helpmenu_lengtht   entryt   cmd(    (    s*   /usr/lib/python2.5/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  (	   RU  RM   R   RW   RO   RQ   R"  R#  R$  (   t   helpfilet   url(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   display_extra_help  s
    (    (   R   R  R  (    (    s*   /usr/lib/python2.5/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   RH   t    R>   RI   (   RM   R   R   Rf   R$  t	   readlinesR   R  t   removeR  t   appendt   lent
   writelinesR`   Rd   Rq  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(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     sF     (2 	 c            s   |   f d  } | S(   Nc            s     i  i d |   d  S(   Nt   editFile(   R   R$  (   t
   fn_closure(   R   (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   open_recent_file  s    (    (   R   R  R  (    (   R   s*   /usr/lib/python2.5/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_savedR`   t   wm_titlet   wm_iconname(   R   t   shortt   longt   titlet   icon(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    


c         C   s   |  i  i   S(   N(   R   R  (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    c         C   s   |  i  i |  d  S(   N(   R   t	   set_saved(   R   t   flag(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    c         C   s   |  i  i   d  S(   N(   R   t
   reset_undo(   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    c         C   s6   |  i  i } | o t i i |  } n |  i |  S(   N(   R   R   RM   R   R   R   (   R   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    c         C   s   |  i  |  i i p d  S(   NR;  (   R   R   R   (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    c         C   s   |  i    d  S(   N(   RN  (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRv     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*   R`   t   botR:  R9   t   newtop(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRN    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   R9   (   R*   R  t   winfo_heightR}  (   R   R*   R`   R  R9   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    	 c         C   s"   |  i  } t t | i |    S(   N(   R*   R}  R  R   (   R   R  R*   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    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+)(   R`   t   wm_geometryt   ret   matcht   mapR}  t   groups(   R   t   geomt   mt   tuple(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   get_geometry!  s    c         C   s   |  i    d  S(   N(   R   (   R   R<   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRr   (  s    c         C   sq   |  i  oc |  i   pE |  i i   d j o |  i i   n |  i i   |  i i   n |  i  i   Sn d  S(   NR/   (   R   R  R`   R(  t	   deiconifyt   lowert   liftt	   maybesave(   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  +  s    
c         C   s1   |  i    } t |  d j o |  i   n | S(   Nt   cancel(   R  RA  t   _close(   R   t   reply(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   4  s    c         C   s  |  i  i o |  i d |  i  i  n t i |  i  |  i o |  i   n d  |  _ d } |  i	   |  i  i
   d  |  _  d  |  _ |  i o0 |  i i } | o |  i } |  i i
 |  n d  |  _ d  |  _ |  i i
   d  |  _ | p |  i i   n d  S(   NR  i    (   R   R   R   R^   t   unregister_callbackR   RW  R   RY   t   unload_extensionsR   R   R   t
   colorizingR`   R*   Rb   R   t   destroy(   R   R  t   doh(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  :  s*    
	
 		
		 	c         C   s   h  |  _  |  i   d  S(   N(   t
   extensionst   load_standard_extensions(   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   O  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(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  S  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(   Rh  t   load_extensiont   reprt	   tracebackt	   print_exc(   R   R&   R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  Y  s     c         C   s   t  i d t  S(   Nt   editor_only(   R   t   GetExtensionsRQ  (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRh  b  s    c         C   se  y t  | t   t   g   } Wn  t j
 o d G| GHd  Sn 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: Rp  t   -t   _i   t   <it   >t   _event(   t
   __import__t   globalst   localsR   t   getattrR   Ri  R  R   Rp  R  Ro   Rq  R6  R*   Rq   (   R   R&   t   modt   clsRj  R  t   veventt
   methodname(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  e  s2    		   
c         C   sk   | d  j o |  i i } n |  i } | | _ x5 | i   D]' \ } } | o | i | |  q< q< Wd  S(   N(   R   Rd  Re  R*   Rj  Rf  R   (   R   Rj  R*   R<   Rk  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRo   }  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  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR>     s    RH   RI   R>   Ro  t   variableN(   R   Rd  Rp  Re  R   R*   R   R   R   Ru  t   get_var_objt
   BooleanVart   add_checkbuttonR  (   R   Rp  Rj  R   R*   t   mnamet	   entrylistR%   R  RH   R  t   checkbuttonRI   Ro  R>   t   var(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s<    		  c         C   s7   |  i  |  } | o | i   } | Sn
 t |  d  S(   N(   R  R   R@  (   R   R&   R  t   value(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   getvar  s
    c         C   s7   |  i  | |  } | o | i |  n
 t |  d  S(   N(   R  R   R@  (   R   R&   R  t   vartypeR  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   setvar  s    c         C   sC   |  i  i |  } | o% | o | |  i  |  i  | <} n | S(   N(   Rb   R   R*   (   R   R&   R  R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR    s    c         C   sB   |  i  o0 |  i i d |  p d |  i i |  j Sn d Sd  S(   Nt   TODOt   STRINGi   (   R   R*   t   tag_prevranget	   tag_names(   R   t
   text_index(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   is_char_in_string  s    
c         C   sP   y2 |  i  i d  } |  i  i d  } | | f SWn t j
 o d Sn Xd  S(   Ns	   sel.firsts   sel.last(   NN(   R*   R   R)  R   (   R   t   firstt   last(    (    s*   /usr/lib/python2.5/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(    (    s*   /usr/lib/python2.5/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(   NRE   t   measures
   -displayoft   nR  (   R*   R  t   tkt   callRF  t	   configure(   R   t   newtabwidthR*   t   pixels(    (    s*   /usr/lib/python2.5/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  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c         C   s  |  i  } |  i   \ } } | o/ | o( | i | |  | i d |  d Sn | i d d  } | d j o9 | i d d d  o | i d  n | i   d Sn | d d	 j o | i d  d Sn |  i } t | i	 |   } | d
 j p t
  | d |  i |  i } t i i d  d }	 d
 }
 xa | |	 j o Pn | d  } |
 d }
 t | i	 |   } | | j p | d d	 j o Pq8q8| i   | i d |
 d  | | j  o | i d d | |  n | i   d S(   NR  R;   s   insert linestartR;  R  s   1.0s	   insert-1cis    	i    i   s   
s
   insert-%dcR  (   R*   R  R  R  R   t   compareR9  R   R  t
   expandtabst   AssertionErrorR   RO   R[   R   R   R  R   (   R   R<   R*   R  R  t   charsR   t   havet   wantt   last_line_of_promptt   ncharsdeleted(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     sF    	
	



c   
      C   sT  |  i  } |  i   \ } } | i   z| oU | oN t |  t |  j o |  i |  Sn | 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  R;   (   R*   R  R   t
   index2lineR   R  R  R   t
   classifywsR   R  t   reindent_toR   R   R  R  R'  R   (
   R   R<   R*   R  R  RP   t   rawt	   effectivet   padR  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   +  s,    	


	c      	   C   s7  |  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 Sn | |  } 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  q]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 |  n | t i j o |  i | i     ng | t i! j o> | i"   d j o | i d |  q|  i | i#    n d p t$ d | f  d Sn | 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   
R;   is   insert - %d charss   .0t   consoles   1.0s   bogus continuation type %r(,   R*   R  R   R  R  R   R  R  RO   R[   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_indentR  t   get_base_indent_stringt   is_block_openerR   t   is_block_closerR   R'  R   (   R   R<   R*   R  R  R   R  R  t   indentR  t   lnoR
  t   contextt   startatt   startatindext   rawtextt   bodR  t   c(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   N  s    	
 
 %
 

 	c         C   s   | |  i  d  } | S(   Nc         S   s   | | d |   S(   Ns   +%dc(    (   t   offsett   _startindext   _icis(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   inner  s    (   R  (   R   t
   startindexR9  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    c   
      C   s   |  i    \ } } } } xo t t |   D][ } | | } | oD t | |  i  \ } }	 |	 |  i }	 |  i |	  | | | | <q+ q+ W|  i | | | |  d S(   NR;   (   t
   get_regionRr  R  R  R   R   t   _make_blankst
   set_region(
   R   R<   RI  RJ  R  t   linest   posR   R  R  (    (    s*   /usr/lib/python2.5/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    R;   (	   R;  Rr  R  R  R   R  R   R<  R=  (
   R   R<   RI  RJ  R  R>  R?  R   R  R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s     
#c         C   sk   |  i    \ } } } } x6 t t |  d  D] } | | } d | | | <q/ W|  i | | | |  d  S(   Ni   s   ##(   R;  Rr  R  R=  (   R   R<   RI  RJ  R  R>  R?  R   (    (    s*   /usr/lib/python2.5/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   #(   R;  Rr  R  R=  (   R   R<   RI  RJ  R  R>  R?  R   (    (    s*   /usr/lib/python2.5/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  (   R;  t   _asktabwidthRr  R  R  t   divmodR=  (   R   R<   RI  RJ  R  R>  R   R?  R   R  R  t   ntabst   nspaces(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s     
&c         C   sr   |  i    \ } } } } |  i   } x1 t t |   D] } | | i |  | | <q7 W|  i | | | |  d  S(   N(   R;  RA  Rr  R  R  R=  (   R   R<   RI  RJ  R  R>  R   R?  (    (    s*   /usr/lib/python2.5/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 columnsR8  i   R;   (   RE  RF  (   s   will bes
   remains at(   R   R   R*   R   (   R   R<   (    (    s*   /usr/lib/python2.5/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)R8  R=  t   minvaluei   t   maxvaluei   R;   (   R   R*   R   R   (   R   R<   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     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  RI  RJ  R  R>  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR;    s    	c         C   s   |  i  } d i |  } | | j o | i   d  Sn | i d d d  | i d |  | i   | i | |  | i | |  | i   | i	 d | d  d  S(   Ns   
R  s   1.0RK   R  (
   R*   RN   R9  R  R  R   R  R  R   R&  (   R   RI  RJ  R  R>  R*   t   newchars(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR=  *  s    	


c         C   sB   |  i  o, t | |  i  \ } } d | d | Sn	 d | Sd  S(   Ns   	R  (   R   RB  R   (   R   R  RC  RD  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR<  :  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  R<  R   (   R   R   R*   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  D  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)R8  R=  RG  i   RH  i   (   R   R*   R   R   (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRA  M  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(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  [  s    !
(   s   fileR   (   s   editR   (   R   R   (   s   runR   (   R   R   (   s   windowsR   (   s   helpR   (   s   windowsR   (   R  s   <<close-window>>(r   R   t
   __module__R   R   R   R   R   R   Rd  t   TkinterR   R    R   RL   R   R   R   R   R   R   RU   RV   Rn   R   R  R   R  R  Ry   Rz   Rw   Rx   Rs   Rt   Ru   R|   R}   R   R   R   R~   R   R   R   R   R   R{   R   R   RO  R   RW  RX  R   R[  R\  Ra  Rb  Rn  R|  R   R   R  R   R  R   R  R  R  R  R  Rv   RN  R  R  R  Rr   R  R   R  R   R  R  Rh  R  Ro   R   R  R  R  R  R  R  R
  RQ  R   R   R   R   R   R   R   R   R   R   R   R   R   R;  R=  R<  R  RA  R  (    (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR   *   s   						
															!					
						
		 			(									
													%							-	#	k												
			c         C   s   t  t |    S(   N(   R}  R  (   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  e  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(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR  m  s    
 

RJ  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   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    		c         C   sn   |  i  o d Sn |  i d } |  _ t |  d } |  i i | d d  o d Sn |  i i | | d  S(   NR;  i   s   .0s   >=RK   s    lineend+1c(   RS  R  R  R*   R  R   (   R   R  R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRS    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   (   RS  RT  RU  (	   R   RB   t   tokent   startRK   R   t   INDENTt   NAMEt   OPENERS(    (    s*   /usr/lib/python2.5/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   tokenizeRS  Ra  t
   TokenErrorRT  RU  (   R   t   save_tabsize(    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    		
(   RV  RW  RX  RY  RZ  R[  (	   R   RO  R   RS  Rb  R^  R_  Ra  R   (    (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRJ  ~  s   		
	c         C   s@   |  i  d  } | d j o |  |  |  | d }  n | |  f S(   NR  i    i   (   R0  (   RQ  R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR     s    t   [t   bracketleftt   ]t   bracketrightt   /t   slashc         C   s   |  i  |  } | p d Sn | 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(   NR;  i    s   -[a-z]\bc         S   s   |  i    i   S(    (   t   groupt   upper(   R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR=     s    s   \b\w+\bc         S   s   t  i |  i   |  i    S(    (   t   keynamesR   Rm  (   R  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyR=     s    s   Key-t   Cancels
   Ctrl-Breaks   Control-s   Ctrl-R  t   +s   ><R  R  R  (   R   R  t   sub(   Rj  R  Rk  RQ  (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyRu    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  (   RZ   R  (    (    s*   /usr/lib/python2.5/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  S(   Ni   RZ   R   (   t   TkRv  t   withdrawRO   t   argvR   R   RX  t   quitt   mainloopR  (   RZ   R   R   (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pyt   test  s    	


t   __main__((   RO   RM   R  R   t	   itertoolsR    RP  R   R   t	   MultiCallR   R#  t   idleverR^   R/  R3  R5  R  t   configHandlerR   R  R  R  RU   R   R   R   t   objectR   R  R  Rd  Rb  RJ  R   Ro  Ru  Rv  R|  R   (    (    (    s*   /usr/lib/python2.5/idlelib/EditorWindow.pys   <module>   sT   
$     @		2								