
?`c           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Td  d l Z d  d l Z d  d l Z d  d l m	 Z	 d  d l
 m Z d  d l
 m Z d  d l
 m Z d  d l
 m Z d  d l
 m Z d  d	 l
 m Z d  d
 l m Z d  d l
 m Z m Z m Z d  d l
 m Z d Z d   Z e d  Z d e f d     YZ e   Z d e f d     YZ d   Z d   Z  d  d l! Z! e! Z" [! d e f d     YZ# d   Z$ i d d 6d d 6d d 6Z% d   Z& d    Z' d!   Z( e) d" k re(   n  d S(#   iN(   t   *(   t   MultiCallCreator(   t   idlever(   t
   WindowList(   t   SearchDialog(   t
   GrepDialog(   t   ReplaceDialog(   t   PyParse(   t   idleConf(   t   aboutDialogt   textViewt   configDialog(   t   macosxSupporti   c          C   s   t  j \ }  } } } } d |  | f } | rB | d | f 7} n  | d k rb | d | f 7} n' | d k r | d | d | f 7} n  | S(   sY   Format sys.version_info to produce the Sphinx version string used to install the chm docss   %s%ss   %st	   candidates   rc%st   finali    (   t   syst   version_info(   t   majort   minort   microt   levelt   serialt   release(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   _sphinx_version   s    c   
      C   sS  d } x |  j d  D] } | d k	 r5 | j   n  t j | |  \ } } } | d t j k rg Pn  t j | | | |  } y | j } Wq t k
 r t	 d | j
  q Xq W| d t j k rFt |   } y | j } Wn t k
 r qFXd } t j j |  \ } }	 |	 d k r'd }	 n  | |	 } | d t j f } n  | | | f S(   sC   Version of imp.find_module() that handles hierarchical module namest   .i   s   No source for module s   .pycs   .pyN(   t   Nonet   splitt   closet   impt   find_modulet	   PY_SOURCEt   load_modulet   __path__t   AttributeErrort   ImportErrort   __name__t
   __import__t   __file__t   ost   patht   splitext(
   t   fullnameR'   t   filet   tgtt   filenamet   descrt   modulet   mt   baset   ext(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   _find_module$   s2    	
t
   HelpDialogc           B   s;   e  Z d    Z d d  Z d   Z d   Z d d  Z RS(   c         C   s   d  |  _ d  |  _ d  S(   N(   R   t   parentt   dlg(   t   self(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   __init__G   s    	c         C   s9   |  j  d k r |  j |  n  | r5 |  j |  n  d S(   s    Display the help dialog.

            parent - parent widget for the help window

            near - a Toplevel widget (e.g. EditorWindow or PyShell)
                   to use as a reference for placing the help window
        N(   R5   R   t   show_dialogt
   nearwindow(   R6   R4   t   near(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   displayK   s    c         C   sr   | |  _  t j j t j j t j j t   d  } t j | d | d t	 |  _
 } | j d |  j d  d  S(   Ns   help.txtt   Helpt   modals	   <Destroy>t   +(   R4   R&   R'   t   joint   abspatht   dirnameR%   R
   t	   view_filet   FalseR5   t   bindt   destroy(   R6   R4   t   fnR5   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR8   X   s    	-"c         C   s\   |  j  } | j   d | j   d f } | j   | j d |  | j   | j   d  S(   Ni
   s   =+%d+%d(   R5   t   winfo_rootxt   winfo_rootyt   withdrawt   geometryt	   deiconifyt   lift(   R6   R:   R5   t   geom(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR9   ^   s    	 

c         C   s   d  |  _ d  |  _ d  S(   N(   R   R5   R4   (   R6   t   ev(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRE   i   s    	N(   R#   t
   __module__R7   R   R;   R8   R9   RE   (    (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR3   E   s
   			t   EditorWindowc           B   s  e  Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 m
 Z
 m Z d  d l m Z d  d l m Z d  d l m 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 j   re d =d e d <n  d   Z d    Z d~ Z d!   Z  d g Z! d$   Z" d%   Z# d&   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~ d0  Z. d1   Z/ d2   Z0 d3   Z1 d4   Z2 d5   Z3 d6   Z4 d7   Z5 d8   Z6 d9   Z7 d~ d:  Z8 d~ d;  Z9 d~ d<  Z: d=   Z; d>   Z< d?   Z= d@   Z> dA   Z? dB   Z@ dC   ZA dD   ZB dE   ZC dF   ZD dG   ZE dH   ZF dI   ZG dJ   ZH d~ dK  ZI dL   ZJ dM   ZK dN   ZL dO   ZM dP   ZN dQ   ZO dR   ZP dS   ZQ dT dU  ZR dV   ZS dT dW  ZT dX   ZU dY   ZV dZ   ZW d[   ZX d\   ZY d]   ZZ d^   Z[ d_   Z\ d`   Z] da   Z^ d~ db  Z_ d~ d~ dc  Z` dd   Za d~ de  Zb d~ df  Zc dg   Zd dh   Ze di   Zf dj   Zg eh dk  Zi dl   Zj dm   Zk dn   Zl do   Zm dp   Zn dq   Zo dr   Zp ds   Zq dt   Zr du   Zs dv   Zt dw   Zu dx   Zv dy   Zw dz   Zx d{   Zy d|   Zz d}   Z{ RS(   i(   t
   Percolator(   t   ColorDelegator(   t   UndoDelegator(   t	   IOBindingt   filesystemencodingt   encoding(   t   Bindings(   t   Toplevel(   t   MultiStatusBarc      
   C   s	  t  j d  k rst j j t j d d  } t j j	 d  r d d t j
 d  } t j j d  rl d } q
d	 } t j j | | d d  } nz t j d  d
 k r t j j t j d d t    } t j j |  r
| } q
n' t j   r
t j j t j d  } n  t j j |  } t j j |  r\| t  _ t j d k rpd t  j t  _ qpqsd t j
 d  t  _ n  t j   }	 | |  _ | p| j } | |  _ y t j Wn t k
 rd t _ n Xt |  |  _ t j | d |  j |  _ }
 | r| j |  _ | j |  j _ n i  |  _ i  |  j _ t j j t j    d  |  _! t" |
  |  _# } t$ | d d |  _% } t j& d d d d d |  _' i d d 6d d 6d d 6|  j' d 6t j& d d d  d d d  6} t( d! k rd" | d# <n  t) t*  | |  |  _+ } |  j+ |  j _, |  j-   |  j.   |  j j/ d$ |  j0  |  j j1 d% |  j2  t j   r| j1 d% |  j2  | j1 d& |  j3  n | j1 d' |  j3  | j1 d( |  j4  | j1 d) |  j5  | j1 d* |  j6  | j1 d+ |  j7  | j1 d, |  j8  | j1 d- |  j9  | j1 d. |  j:  | j1 d/ |  j;  | j1 d0 |  j<  | j1 d1 d2    | j1 d3 |  j=  | j1 d4 |  j>  | j1 d5 |  j?  | j1 d6 |  j@  | j1 d7 |  jA  | j1 d8 |  jB  | j1 d9 |  jC  | j1 d: |  jD  | j1 d; |  jE  | j1 d< |  jF  | j1 d= |  jG  | j1 d> |  jH  | j1 d? |  jI  | j1 d@ |  jJ  | j1 dA |  jK  | j1 dB |  jL  | j1 dC |  jM  | j1 dD |  jN  | j1 dE |  jO  | j1 dF |  jP dG   | j1 dH |  jP dI   | j1 dJ |  jQ  | j1 dK |  jR  | j1 dL |  jS  | r| | j |  <| r_|  | jT | <n  | j1 dM |  jU  | j1 dN |  j jV  | j1 dO |  jW  | j1 dP |  jX  n  |  jY   | jZ | dQ <| j[ dR t\ dS t]  | j^ | dT <dU } t j& d d dV d dW rdX } n  | j_ dY t j& d d dY  t j& d d dZ d d | f  | j[ dR t` dS ta d[ dI  | j[ dR tb dS ta d[ dI  | jc   t j& d d\ d] d dW } | |  _d d^ |  _e |  je |  _f |  jg   th |  _i di |  _j |  jk |  |  _l } |  jm   |  _n } | jo |  | jp | _p | jq | _q | jr |  js  |  jt |   |  _u } | jv |  jw  t |  j  |  _x |  jy db jz d dc dd de dG d |  jx |  j{   d  |  _| | r	t j j} |  rt j j |  r| j~ |  q	| j |  n  |  j   |  js   |  j |  j |   |  j   |  jy j df  } | r	| j dg  } | d  k rw	dh } n  | dG k r	| j   | dI } n  | |  _ t j |  j  n  t j |  _ t j |  _ t j |  _ d  S(j   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%s.chms0   Resources/English.lproj/Documentation/index.htmlt   darwins   file://s   http://docs.python.org/%d.%di   s   >>> t   menus   recent-files.lstt   namet   vbart   mainRP   t   widtht   typet   intt   texti   t   padxt   nonet   wrapt   heightg      !@t   wordprocessort   tabstylet   WM_DELETE_WINDOWs   <<close-window>>s   <Control-Button-1>s   <3>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(   Nt   break(    (   t   event(    (    s,   /usr/lib64/python2.7/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   <<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   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 (   RP   t   help_urlR   R&   R'   R?   R   t   prefixt   platformt   countR   t   isdirR   t   isfileR   t   runningAsOSXAppt   normpathR   t   CurrentThemet   flistt   roott   ps1R!   t   Menut   menubarR   t   ListedToplevelt   topt   varst   tkinter_varst   inversedictt   instance_dictt   GetUserCfgDirt   recent_files_patht   Framet
   text_framet	   ScrollbarR`   t	   GetOptionRb   t	   TkVersionR   t   TextRe   t   focused_widgett   createmenubart   apply_bindingst   protocolR   RD   t   close_eventt   right_menu_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   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_indentwidthRC   t   context_use_ps1t   num_context_linesRQ   t   perRS   t   undot   insertfiltert   undo_block_startt   undo_block_stopt   set_saved_change_hookt   saved_change_hookRT   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(   R6   R   R,   t   keyR   t   dochomet   pyvert   basepatht   chmfilet   currentThemeR   R   R`   t   text_optionsRe   t
   fontWeightt	   usespacesR   R   R   R^   R}   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR7   {   s>   					



	


	
		

	%


	
	c         C   sx   t  | t  s | r | Sy | j |  j  SWnC t k
 rs y | j |  j  SWqt t k
 ro | j d  SXn Xd S(   s8   convert filename to unicode in order to display it in Tks	   iso8859-1N(   t
   isinstancet   unicodet   decodeRU   t   UnicodeDecodeErrorRV   (   R6   R,   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   _filename_to_unicode]  s    c         C   s)   |  j  j   \ } } |  j j |  d S(   NRm   (   R   t   defaultfilenameR   t   new(   R6   Rn   RA   t   basename(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   l  s    c         C   s|  | j  d @d k r& | j d k r& d  S|  j j d  r |  j j d d d  r |  j j d d d  r t |  j j d  j d  d	  } nR |  j j d d  } x: t t	 |   D] } | | d k r Pq q Wt	 |  } t |  j j d  j d  d	  } | | k rd } n  d t
 |  d } | j  d	 @d k r\|  j j d d d  n |  j j d  s|  j j d d  nY |  j j |  j j d  d |  j j d   r|  j j d d  n |  j j d d  |  j j |  } |  j j d  } |  j j | d |  r)| | } } n  |  j j d d d  |  j j d | |  |  j j d |  |  j j d  d S(   Ni   i    t   Homet   iomarks   <=s   insert lineends   insert linestartR   i   t    s   	t   inserts   insert linestart+t   ct   sels   1.0R}   s	   sel.firstt	   my_anchort   <s   sel.lastt   >Rm   (   R
  s   	(   t   statet   keysymRe   R   t   compareRd   R   R   t   xranget   lent   strt
   tag_removet   mark_sett   tag_addt   see(   R6   Rn   t   insertptt   linet   lineatt   destt   firstt   last(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   q  s>    "(%	0c         C   s   |  j  |  j  |  _ t j   r= |  j j d d d t n  |  j j d d d t |  j j d d d t |  j j d t d t	  |  j
 j d	 |  j  |  j
 j d	 d
 d  |  j
 j |  j  d  S(   Nt	   _padding1s       Rq   t   columns   Col: ?R  s   Ln: ?Rr   s   <<set-line-and-column>>s   <KeyRelease>s   <ButtonRelease>(   RY   R   t
   status_barR   R   t	   set_labelR   R   t   BOTTOMt   XRe   RD   t   set_line_and_columnt	   event_addt
   after_idle(   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    
c         C   sS   |  j  j t  j d  \ } } |  j j d d |  |  j j d d |  d  S(   NR   R"  s   Col: %sR  s   Ln: %s(   Re   R   t   INSERTR   R#  R$  (   R6   Rn   R  R"  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR'    s    !R*   t   _Filet   editt   _Editt   formatt   F_ormatt   runt   _Runt   optionst   _OptionsR|   t   _Windowst   helpt   _Helpit   _Windowic         C   s   |  j  } i  |  _ } x_ |  j D]T \ } } t |  \ } } t | d | | | <} | j d | d | d |  q  Wt j |  j  r t | d d | d <} | j d d d |  n  |  j	   |  j d j
 t  |  _ |  j   d  S(	   NR_   Rz   R^   R{   t   applet   applicationt   IDLER5  (   R   R   t
   menu_specst   prepstrR   t   add_cascadeR   t   isCarbonAquaTkR   t
   fill_menusR   t   ENDt   base_helpmenu_lengtht   reset_help_menu_entries(   R6   t   mbarR   R_   Rz   R{   R^   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    	 
c         C   sk   |  j  d } | j d  } | d  k r1 d } n  | |  j k rZ | j |  j d |  n  t j |  d  S(   NR|   R}   ii   (   R   R   R   R   t   deleteR   t   add_windows_to_menu(   R6   R^   R}   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    	c   	      C   s%  |  j  j d d | j | j f  |  j s9 |  j   n  |  j } | |  _ t j d  d k } | rz |  j  j	 d d  n  xr |  j
 D]g } y | \ } } } Wn t k
 r q n X| d  k r q n  t |  |    } | j | d | q W| j | j | j  | r!|  j  j	 d d  n  d  S(	   NR  s   @%d,%di   R\   t   cursort   arrowR  t   ibeam(   Re   R  t   xt   yt   rmenut
   make_rmenuRn   R   R   R   t   rmenu_specst
   ValueErrorR   t   getattrt   entryconfiguret   tk_popupt   x_roott   y_root(	   R6   Rn   RK  t   iswint   itemRz   t	   eventnamet   verify_stateR  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s(    #			t   Closes   <<close-window>>c         C   s   t  |  j d d } xg |  j D]\ } | d | d } } | d  k	 rq |  j | d  } | j d | d |  q | j   q W| |  _ d  S(   Nt   tearoffi    i   c         S   s   |  j  |  d  S(   N(   t   event_generate(   Re   RV  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRp     s    Rz   Rp   (   R   Re   RM  R   t   add_commandR   RK  (   R6   RK  RU  Rz   RV  Rp   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRL    s    c         C   s
   |  j    S(   N(   t   rmenu_check_copy(   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   rmenu_check_cut  s    c         C   s=   y |  j  j d  } Wn t k
 r* d SX| r5 d Sd Sd  S(   Ns	   sel.firstt   disabledRt   (   Re   R   t   TclError(   R6   t   indx(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR\    s
    c         C   s=   y  |  j  j j d |  j  d  Wn t k
 r4 d SXd Sd  S(   Ns   tk::GetSelectiont	   CLIPBOARDR^  Rt   (   Re   t   tkt   callR_  (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   rmenu_check_paste  s
     c         C   s   t  j |  j d  d  S(   Ns
   About IDLE(   R	   t   AboutDialogR   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    c         C   s   t  j |  j d  d  S(   Nt   Settings(   R   t   ConfigDialogR   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    c         C   s8   |  j  r |  j  } n	 |  j } t j | d |  j d  S(   NR:   (   R   R   t
   helpDialogR;   (   R6   Rn   R4   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    		c         C   sy   t  j d  d k re y t j |  j  Wqu t k
 ra } t j d d d t |  d |  j	  qu Xn t
 j |  j  d S(   Ni   R\   t   titles   Document Start Failuret   messageR4   Rm   (   R   R   R&   t	   startfileR~   t   WindowsErrorR   R   R  Re   t
   webbrowsert   open(   R6   Rn   t   why(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   #  s    c         C   s   |  j  j d  d S(   Ns   <<Cut>>Rm   (   Re   RZ  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   .  s    c         C   s*   |  j  j d  s d  S|  j  j d  d S(   NR  s   <<Copy>>Rm   (   Re   t
   tag_rangesRZ  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   2  s    c         C   s$   |  j  j d  |  j  j d  d S(   Ns	   <<Paste>>R  Rm   (   Re   RZ  R  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   9  s    c         C   s=   |  j  j d d d  |  j  j d d  |  j  j d  d S(   NR  s   1.0s   end-1cR  Rm   (   Re   R  R  R  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   >  s    c         C   s*   |  j  j d d d  |  j  j d  d  S(   NR  s   1.0R}   R  (   Re   R  R  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   D  s    c            s:   |  j  j  |  j  j  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            sM   |  j  d @d k rI y  d   d     WqI t k
 rE qI Xn  d  S(   Ni   i    s	   sel.firstR  (   R  R_  (   Rn   (   t
   edge_indext   edges_tablet   self_text_indext   self_text_mark_set(    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   move_at_edgeS  s    
(   s   sel.first+1cs   sel.last-1c(   Re   R   R  (   R6   Rq  Ru  (    (   Rq  Rr  Rs  Rt  s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   H  s
    c         C   s   |  j  j d  d S(   Ns   <Meta-Delete>Rm   (   Re   RZ  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   \  s    c         C   s   |  j  j d  d S(   Ns   <Meta-d>Rm   (   Re   RZ  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   `  s    c         C   s   t  j |  j  d S(   NRm   (   R   t   findRe   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   d  s    c         C   s   t  j |  j  d S(   NRm   (   R   t
   find_againRe   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   h  s    c         C   s   t  j |  j  d S(   NRm   (   R   t   find_selectionRe   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   l  s    c         C   s    t  j |  j |  j |  j  d S(   NRm   (   R   t   grepRe   R   R   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   p  s    c         C   s   t  j |  j  d S(   NRm   (   R   t   replaceRe   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   t  s    c         C   sp   |  j  } t j d d d | } | d  k r1 d S| d k rK | j   d S| j d d |  | j d  d  S(   Nt   Gotos   Go to line number:R4   Rm   i    R  s   %d.0(   Re   R   R   R   t   bellR  R  (   R6   Rn   Re   t   lineno(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   x  s    		
c   	      C   sP  y |  j  j d d  } Wn t k
 r2 d } n X| j   } t j d d d |  j  d | } | ru | j   } n  | s d  Sy" t |  \ } } \ } } } Wn9 t t f k
 r } t	 j
 d t |  d |  j  d  SX| t j k rt	 j
 d	 d
 | d |  j  d  S| r | j   n  |  j r<|  j j |  n |  j j |  d  S(   Ns	   sel.firsts   sel.lastt    t   ModulesA   Enter the name of a Python module
to search on sys.path and open:R4   t   initialvalues   Import errors   Unsupported types   %s is not a source module(   Re   R   R_  t   stripR   t	   askstringR2   t	   NameErrorR"   R   R   R  R   R   R   R   Rn  R   R   (	   R6   Rn   R_   t   fR*   t   suffixt   modeRc   t   msg(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s4    
	"		c         C   s   |  j  j } | s< t j d d d |  j |  j j   d  St j j	 |  \ } } t j j
 |  \ } } d d l m } | j |  j | | g  d  S(   Ns   No filenames&   This buffer has no associated filenamet   masteri(   t   ClassBrowser(   R   R,   R   R   Re   R   R   R&   R'   R   R(   t   idlelibR  R   (   R6   Rn   R,   t   headt   tailR0   R1   R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    
c         C   s$   d d l  m } | j |  j  d  S(   Ni(   t   PathBrowser(   R  R  R   (   R6   Rn   R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    c         C   sl   | d  k	 rh | d k rh |  j j d d |  |  j j d d d  |  j j d d d  |  j   n  d  S(   Ni    R  s   %d.0R  s   1.0R}   s
   insert +1l(   R   Re   R  R  R  t   center(   R6   R}  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   gotoline  s
    c         C   s   | s t  j j |  r t St  j j t  j j |   \ } } t  j j |  d k r] t Sy& t |  } | j   } | j	   Wn t
 k
 r t SX| j d  o | j d  d k S(   Ns   .pys   .pyws   #!t   pythoni    (   s   .pys   .pyw(   R&   R'   R   t   TrueR(   R  t   normcaseRn  t   readlineR   t   IOErrorRC   t
   startswithRv  (   R6   R,   R0   R1   R  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    $c         C   s)   |  j  r% |  j  j |   d  |  _  n  d  S(   N(   R   t   unregister_maybe_terminateR   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt
   close_hook  s    	c         C   s   | |  _  d  S(   N(   R  (   R6   R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   set_close_hook  s    c         C   sD   |  j  r |  j  j |   n  |  j   |  j j |   |  j   d  S(   N(   R   t   filename_changed_editR   R   t   update_windowlist_registryR   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s
    	
c         C   s}   |  j  r d  S|  j |  j j  r4 |  j   |  _  n  |  j  ry |  j j |  j  |  j j |  j   |  j j |  j  n  d  S(   N(	   R   R   R   R,   RR   R   t   removefilterR   R   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   _addcolorizer  s    		c         C   s:   |  j  s d  S|  j  j   |  j j |  j   d  |  _  d  S(   N(   R   t   removecolorsR   R  R   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   _rmcolorizer  s
    	c         C   s   |  j    |  j   t j d d d  } t j | d  } t j | d d d } t j | d  } |  j j d	 | d	 d
 | d
 d | d | d	 d | d
  d S(   s   Update the colour themeRa   t   ThemeR_   Rt   RF  t   fgBgt   fgt   hilitet
   foregroundt
   backgroundt   insertbackgroundt   selectforegroundt   selectbackgroundN(   R  R  R   R   t   GetHighlightRe   R   (   R6   t   themet   normal_colorst   cursor_colort   select_colors(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    




c      	   C   sn   d } t  j d d d d d r* d } n  |  j j d t  j d d d  t  j d d d	 d d
 | f  d S(   s.   Update the text widgets' font if it is changedRt   Ra   RP   s	   font-boldRc   Ru   Rv   Rw   s	   font-sizeRd   N(   R   R   Re   R   (   R6   R   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt	   ResetFont  s    	c         C   s   t  j   |  j _ } x- | j   D] \ } } |  j j | |  q# Wx\ |  j   D]N } t  j |  } | rS x0 | j   D] \ } } |  j j | |  q{ WqS qS Wd S(   s/   Remove the keybindings before they are changed.N(	   R   t   GetCurrentKeySetRW   t   default_keydefst   itemsRe   t   event_deletet   get_standard_extension_namest   GetExtensionBindings(   R6   t   keydefsRn   t   keylistt   extensionNamet   xkeydefs(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   RemoveKeybindings	  s    c         C   s  t  j   |  j _ } |  j   x9 |  j   D]+ } t  j |  } | r- |  j |  q- q- Wi  } xd |  j j D]V } i  | | d <x? | d D]3 } | r | d | | d t | d  d <q q Wqo Wx |  j	 j
   D] } |  j	 | } | j t  d } x t d |  D] }	 | j |	  d k r| j |	 d  }
 |
 r| j |	 d  } d } | | k r| | | k r| | | } qn  | rt | |  }
 | j |	 d |
 qqqqWq Wd S(   s-   Update the keybindings after they are changedi    i   Rp   t   acceleratorRz   R~  N(   R   R  RW   R  R   R  R  t   menudefsR<  R   t   keysR   R@  t   rangeRc   t	   entrycgett   get_acceleratort   entryconfig(   R6   R  R  R  t   menuEventDictR^   RU  t   menubarItemR}   R   t   accelt   itemNameRn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   ApplyKeybindings  s6    
/c         C   s.   |  j  s* t j d d d d d |  _ n  d S(   sC   Update the indentwidth if changed and not using tabs in this windowRa   Ry   s
   num-spacesRc   Rd   N(   R   R   R   R   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   5  s    	c         C   s   t  j   } |  j d } | j t  } | |  j k rQ | j |  j d |  n  | r | j   x> | D]3 } |  j | d  } | j	 d | d d |  qh Wn  | |  j d <d S(   s3   Update the additional help entries on the Help menuR5  i   Rz   i    Rp   N(
   R   t   GetAllExtraHelpSourcesListR   R   R@  RA  RD  R   t"   _EditorWindow__extra_help_callbackR[  (   R6   t	   help_listt   helpmenut   helpmenu_lengtht   entryt   cmd(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRB  <  s    
!c            s   |   f d  } | S(   sC   Create a callback with the helpfile value frozen at definition timec            s   |  j  d	  s$ t j j |   }  n  t j d  d k r y t j |   Wq t k
 r } t j	 d d d t
 |  d   j  q Xn t j |   d  S(
   Nt   wwwt   httpi   R\   Ri  s   Document Start FailureRj  R4   (   R  R  (   R  R&   R'   R   R   R   Rk  Rl  R   R   R  Re   Rm  Rn  (   t   helpfileRo  (   R6   (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   display_extra_helpO  s    (    (   R6   R  R  (    (   R6   s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   __extra_help_callbackM  s    c      
   C   s\  g  } t  j j |  j  rN t |  j d  } z | j   } Wd | j   Xn  | r t  j j |  d } | | k r | j |  n  | j	 d |  n  g  } xD | D]< } d | k s t  j j | d d ! r | j
 |  q q Wg  | D] } | | k r | ^ q } d } | d t |  !} y, t |  j d   } | j |  Wd QXWn` t k
 r} t |  j d	 t  st |  j _ t j d
 d d d t |  d |  j  qn Xx |  j j j   D] }	 |	 j }
 |
 j d t  xl t |  D]^ \ } } | j   } |  j |  } |	 j  |  } |
 j! d | | d | d | d d  qWqWd S(   s/   Load and update the recent files list and menust   rNs   
i    t    it   1234567890ABCDEFGHIJKt   wt   recentfilelist_error_displayedRi  s
   IDLE ErrorRj  s&   Unable to update Recent Files list:
%sR4   Rz   R
  Rp   R{   ("   R&   R'   R   R   Rn  t	   readlinesR   R@   t   removeR  t   appendR  t
   writelinesR  RO  R   RC   R  R  R   R   R  Re   R   R   R  R   RD  R@  t	   enumeratet   rstripR  t#   _EditorWindow__recent_file_callbackR[  (   R6   t   new_filet   rf_listt   rf_list_filet	   bad_pathsR'   t   ulcharst   rf_filet   errt   instanceR^   t   it	   file_namet
   ufile_namet   callback(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   \  sL    &%	c            s   |   f d  } | S(   Nc            s     j  j d |   d  S(   Nt   editFile(   R   Rn  (   t
   fn_closure(   R6   (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   open_recent_file  s    (    (   R6   R  R  (    (   R6   s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   __recent_file_callback  s    c         C   s   |  j    } |  j   } | r5 | r5 | d | } n$ | rD | } n | rS | } n d } | ph | ph | } |  j   s d | } d | } n  |  j j |  |  j j |  d  S(   Ns    - t   Untitleds   *%s*s   *%s(   t   short_titlet
   long_titlet	   get_savedR   t   wm_titlet   wm_iconname(   R6   t   shortt   longRi  t   icon(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    		
c         C   s   |  j  j   S(   N(   R   R  (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s   |  j  j |  d  S(   N(   R   t	   set_saved(   R6   t   flag(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s   |  j  j   d  S(   N(   R   t
   reset_undo(   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s4   |  j  j } | r' t j j |  } n  |  j |  S(   N(   R   R,   R&   R'   R  R  (   R6   R,   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s   |  j  |  j j p d  S(   NR~  (   R  R   R,   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s   |  j    d  S(   N(   R  (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    R  c         C   sb   |  j  } |  j   \ } } |  j |  } | | } t d | | d  } | j t |   d  S(   Ni   i   (   Re   t   getwindowlinest	   getlinenot   maxR   t   float(   R6   t   markRe   R   t   botR}  Ri   t   newtop(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    	
c         C   sp   |  j  } |  j d  } |  j d  } | | k rf | j   d k rf t | d  } | | d } n  | | f S(   Ns   @0,0s   @0,65535i   Ri   (   Re   R  t   winfo_heightRd   (   R6   Re   R   R  Ri   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    	c         C   s"   |  j  } t t | j |    S(   N(   Re   Rd   R  R   (   R6   R  Re   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    	c         C   s:   |  j  j   } t j d |  } t t | j    } | S(   s   Return (width, height, x, y)s   (\d+)x(\d+)\+(-?\d+)\+(-?\d+)(   R   t   wm_geometryt   ret   matcht   mapRd   t   groups(   R6   RM   R/   t   tuple(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   get_geometry  s    c         C   s   |  j    d  S(   N(   R   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    c         C   sh   |  j  rd |  j   sW |  j j   d k r: |  j j   n  |  j j   |  j j   n  |  j  j   Sd  S(   NRt   (   R   R  R   R  RK   t   lowerRL   t	   maybesave(   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR	    s    	c         C   s/   |  j    } t |  d k r+ |  j   n  | S(   Nt   cancel(   R	  R  t   _close(   R6   t   reply(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    c         C   s   |  j  j r% |  j d |  j  j  n  t j |  j  |  j   |  j  j   d  |  _  d  |  _	 |  j
 r |  j
 j t  d  |  _
 n  d  |  _ d  |  _ |  j j   d  |  _ |  j j   |  j r |  j   n  d  S(   NR  (   R   R,   R   R   t   unregister_callbackR   t   unload_extensionsR   R   R   R   RC   Re   R   R   R   RE   R  (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s"    
							c         C   s   i  |  _  |  j   d  S(   N(   t
   extensionst   load_standard_extensions(   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    	c         C   sC   x3 |  j  j   D]" } t | d  r | j   q q Wi  |  _  d  S(   NR   (   R  t   valuest   hasattrR   (   R6   t   ins(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s[   xT |  j    D]F } y |  j |  Wq d Gt |  GHd d  l } | j   q Xq Wd  S(   Ns   Failed to load extensioni(   R  t   load_extensiont   reprt	   tracebackt	   print_exc(   R6   R_   R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   s   t  j d t  S(   Nt   editor_only(   R   t   GetExtensionsR  (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s    c         C   sV  y t  | t   t   g   } Wn t k
 r< d G| GHd  SXt | |  } t j |  } t | d  r |  j | j	 |  n  | |   } | |  j
 | <| rR|  j |  x | j   D] } | j d d  } x | d  d k r | d } q Wx | d d k r| d  } q W| d	 } t | |  r |  j j | t | |   q q Wn  d  S(
   Ns   
Failed to import extension: R  t   -t   _i   R  iR  t   _event(   R$   t   globalst   localsR"   RO  R   R  R  R?  R  R  R   R  Rz  Re   RD   (   R6   R_   t   modt   clsR  R  t   veventt
   methodname(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR    s,    	
c         C   sg   | d  k r |  j j } n  |  j } | | _ x3 | j   D]% \ } } | r: | j | |  q: q: Wd  S(   N(   R   RW   R  Re   R  R  R(  (   R6   R  Re   Rn   R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   (  s    		c         C   sf  | d	 k r |  j j } n  | d	 k r6 |  j j } n  |  j } |  j } x| D]\ } } | j |  } | sv qO n  x | D] } | s | j   q} | \ }	 }
 |	 d  d k } | r |	 d }	 n  t |	  \ } }	 t	 | |
  } | |
 d  } | r8|  j
 |
 t  } | j d |	 d | d | d | d |  q} | j d |	 d | d | d |  q} WqO 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   |  j  |  d  S(   N(   RZ  (   Re   RV  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRp   J  s    Rz   R{   Rp   R  t   variableN(   R   RW   R  R  R   Re   R   R   R<  R  t   get_var_objt
   BooleanVart   add_checkbuttonR[  (   R6   R  R  R   Re   t   mnamet	   entrylistR^   R  Rz   RV  t   checkbuttonR{   R  Rp   t   var(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR?  1  s8    		
c         C   s2   |  j  |  } | r% | j   } | St |  d  S(   N(   R%  R   R  (   R6   R_   R+  t   value(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   getvarV  s
    c         C   s5   |  j  | |  } | r( | j |  n	 t |  d  S(   N(   R%  R   R  (   R6   R_   R,  t   vartypeR+  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   setvar^  s    c         C   s@   |  j  j |  } | r< | r< | |  j  |  j  | <} n  | S(   N(   R   R   Re   (   R6   R_   R.  R+  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR%  e  s    c         C   s<   |  j  r4 |  j j d |  p3 d |  j j |  k Sd Sd  S(   Nt   TODOt   STRINGi   (   R   Re   t   tag_prevranget	   tag_names(   R6   t
   text_index(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   is_char_in_stringu  s    	c         C   sK   y2 |  j  j d  } |  j  j d  } | | f SWn t k
 rF d SXd  S(   Ns	   sel.firsts   sel.last(   NN(   Re   R   R_  R   (   R6   R  R   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   get_selection_indices  s    c         C   s   |  j  d p t } t |  S(   Nt   tabs(   Re   t   TK_TABWIDTH_DEFAULTRd   (   R6   t   current(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   get_tabwidth  s    c         C   s^   |  j  } |  j   | k rZ | j j d d | d d | j d |  } | j d |  n  d  S(   NRw   t   measures
   -displayoft   nR7  (   Re   R:  Rb  Rc  R  t	   configure(   R6   t   newtabwidthRe   t   pixels(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   set_tabwidth  s    		c         C   su   | ra | ra |  j    } d | k o/ d k n r@ | |  _ n  |  j |  j k ra t |  _ qa n  |  j |  j  d  S(   Ni   i   (   t   guess_indentR   R   RC   R   R@  (   R6   R   t   guessR  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    c         C   s  |  j  } |  j   \ } } | rK | rK | j | |  | j d |  d S| j d d  } | d k r | j d d d  r | j d  n
 | j   d S| d d	 k r | j d  d S|  j } t | j	 |   } | d
 k s t
  | d |  j |  j } |  j r't j j d  d }	 n d }	 d
 }
 x\ | |	 k rFPn  | d  } |
 d }
 t | j	 |   } | | k s| d d	 k r6Pq6q6| j   | j d |
 d  | | k  r| j d d | |  n  | j   d S(   NR  Rm   s   insert linestartR~  R  s   1.0s	   insert-1cis    	i    i   s   
s
   insert-%dcR
  (   Re   R6  RD  R  R   R  R|  R   R  t
   expandtabst   AssertionErrorR   R   R   R   R   R   R  R   (   R6   Rn   Re   R  R   t   charsR   t   havet   wantt   last_line_of_promptt   ncharsdeleted(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     sJ    	
		



c   
      C   sH  |  j  } |  j   \ } } | j   z| r| | r| t |  t |  k rY |  j |  S| j | |  | j d |  n  | j d d  } t | |  j	  \ } } | t
 |  k r |  j | |  j  nU |  j r d } n3 t
 | j |  j	   } |  j }	 d |	 | |	 } | j d |  | j d  d SWd  | j   Xd  S(   NR  s   insert linestarts   	R
  Rm   (   Re   R6  R   t
   index2lineR   RD  R  R   t
   classifywsR   R  t   reindent_toR   R   RC  R  R  R   (
   R6   Rn   Re   R  R   R   t   rawt	   effectivet   padR<  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s,    	
			c      	   C   s  |  j  } |  j   \ } } | j   z| rW | rW | j | |  | j d |  n  | j d d  } d t |  } } x* | | k  r | | d k r | d } q W| | k r | j d d  d S| |  } d } t j	 j
 d  d }	 x: | r+| d d k r+| |	 k r+| d  } | d } q W| rI| j d	 | d  n  x& | j d  d k rq| j d  qLW| j d d  t | j d   }
 t j |  j |  j  } |  j s^x |  j D] } t |
 | d  } t |  d
 } | j | d  } | j |  | j |  j |  j |   } | d  k	 s@| d k rPqqW| j | pWd  nW | j d d  } | r| d } n d } | j | d  } | j |  | j d  | j   } | t j k r| t j k rn | t j k r| j d |  n | t j k r)|  j  | j!    nc | t j" k rs| j#   d k r]| j d |  q|  j  | j$    n d st% d | f   d S| j&   } | j d |  | j'   r|  j( |  n" | r| j)   r|  j* |  n  d SWd  | j+ d  | j,   Xd  S(   NR  s   insert linestarti    s    	i   s   
Rm   is   insert - %d charss   .0t   consoles   1.0s   bogus continuation type %r(-   Re   R6  R   RD  R  R   R  R  R   R   R   RJ  R   R   t   ParserR   R   R   R   R  R  t   set_strt   find_good_parse_startt   _build_char_in_string_funcR   t   set_loR2  t   get_continuation_typet   C_NONEt   C_STRING_FIRST_LINEt   C_STRING_NEXT_LINESt	   C_BRACKETRL  t   compute_bracket_indentt   C_BACKSLASHt   get_num_lines_in_stmtt   compute_backslash_indentRD  t   get_base_indent_stringt   is_block_openerR   t   is_block_closerR   R  R   (   R6   Rn   Re   R  R   R  R  R<  t   indentRH  t   lnoRJ  t   contextt   startatt   startatindext   rawtextt   bodR  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    	

%
	c         C   s   | |  j  d  } | S(   Nc         S   s   | | d |   S(   Ns   +%dc(    (   t   offsett   _startindext   _icis(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   innerh  s    (   R5  (   R6   t
   startindexRl  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRT  g  s    c   
      C   s   |  j    \ } } } } xm t t |   D]Y } | | } | r+ t | |  j  \ } }	 |	 |  j }	 |  j |	  | | | | <q+ q+ W|  j | | | |  d S(   NRm   (   t
   get_regionR  R  RK  R   R   t   _make_blankst
   set_region(
   R6   Rn   R  R  RE  t   linest   posR  RM  RN  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   m  s    
"c   
      C   s   |  j    \ } } } } xv t t |   D]b } | | } | r+ t | |  j  \ } }	 t |	 |  j d  }	 |  j |	  | | | | <q+ q+ W|  j | | | |  d S(   Ni    Rm   (	   Rn  R  R  RK  R   R  R   Ro  Rp  (
   R6   Rn   R  R  RE  Rq  Rr  R  RM  RN  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR   x  s    
"c         C   sk   |  j    \ } } } } x6 t t |  d  D] } | | } d | | | <q/ W|  j | | | |  d  S(   Ni   s   ##(   Rn  R  R  Rp  (   R6   Rn   R  R  RE  Rq  Rr  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s
    
c         C   s   |  j    \ } } } } xt t t |   D]` } | | } | sG q+ n  | d  d k rd | d } n | d  d k r | d } n  | | | <q+ W|  j | | | |  d  S(   Ni   s   ##i   t   #(   Rn  R  R  Rp  (   R6   Rn   R  R  RE  Rq  Rr  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    
c         C   s   |  j    \ } } } } |  j   } | d  k r4 d  Sxu t t |   D]a } | | } | rG t | |  \ }	 }
 t |
 |  \ } } d | d | | |	 | | <qG qG W|  j | | | |  d  S(   Ns   	R
  (   Rn  t   _asktabwidthR   R  R  RK  t   divmodRp  (   R6   Rn   R  R  RE  Rq  R   Rr  R  RM  RN  t   ntabst   nspaces(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s     
%c         C   s   |  j    \ } } } } |  j   } | d  k r4 d  Sx1 t t |   D] } | | j |  | | <qG W|  j | | | |  d  S(   N(   Rn  Rt  R   R  R  RC  Rp  (   R6   Rn   R  R  RE  Rq  R   Rr  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s     c         C   sZ   |  j  d d d |  j d d |  j d d	 d
 |  j rV |  j |  _ 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 columnsR4   i   Rm   (   Rx  Ry  (   s   will bes
   remains at(   R   R   Re   R   (   R6   Rn   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    !c         C   s_   |  j  d d d |  j d |  j d d d d } | r[ | |  j k r[ |  j r[ | |  _ n  d	 S(
   Ns   Indent widths6   New indent width (2-16)
(Always use 8 when using tabs)R4   R  t   minvaluei   t   maxvaluei   Rm   (   R   Re   R   R   (   R6   Rn   R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR     s    			c         C   s   |  j  } |  j   \ } } | rP | rP | j | d  } | j | d  } n | j d  } | j d  } | j | |  } | j d  } | | | | f S(   Ns
    linestarts   -1c lineend +1cs   insert linestarts   insert lineend +1cs   
(   Re   R6  R   R   R   (   R6   Re   R  R   R  R  RE  Rq  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRn    s    	c         C   s   |  j  } d j |  } | | k r2 | j   d  S| j d d d  | j d |  | j   | j | |  | j | |  | j   | j	 d | d  d  S(   Ns   
R  s   1.0R}   R  (
   Re   R?   R|  R  R  R   RD  R  R   R  (   R6   R  R  RE  Rq  Re   t   newchars(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRp    s    	


c         C   s=   |  j  r1 t | |  j  \ } } d | d | Sd | Sd  S(   Ns   	R
  (   R   Ru  R   (   R6   R<  Rv  Rw  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRo    s    	c         C   sk   |  j  } | j   | j d d d  r; | j d d  n  | r] | j d |  j |   n  | j   d  S(   Ns   insert linestarts   !=R  (   Re   R   R  RD  R  Ro  R   (   R6   R"  Re   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRL    s    	
c         C   s.   |  j  d d d |  j d |  j d d d d S(	   Ns	   Tab widths   Columns per tab? (2-16)R4   R  Rz  i   R{  i   (   R   Re   R   (   R6   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRt    s    		c         C   sr   t  |  j |  j  j   \ } } | r` | r` t | |  j  \ } } t | |  j  \ } } n
 d } } | | S(   Ni    (   t   IndentSearcherRe   R   R0  RK  (   R6   t   openert   indentedRM  t   indentsmallt   indentlarge(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRA    s    !
N(   s   fileR+  (   s   editR-  (   s   formatR/  (   s   runR1  (   R2  R3  (   s   windowsR4  (   s   helpR6  (   s   windowsR7  (   RX  s   <<close-window>>N(|   R#   RO   t   idlelib.PercolatorRQ   t   idlelib.ColorDelegatorRR   t   idlelib.UndoDelegatorRS   t   idlelib.IOBindingRT   RU   RV   R  RW   t   TkinterRX   t   idlelib.MultiStatusBarRY   R   R~   R7   R  R   R   R   R'  R;  R   R   R   R   RK  R   RM  RL  R]  R\  Rd  R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R   R  R  R   R  R  R   R  R  R  R   RB  R  R   R  R   R  R  R  R  R  R   R  R  R  R  R   R	  R   R  R   R  R  R  R  R   R?  R-  R/  R%  R5  R6  R:  R@  R  R   R   R   R   RT  R   R   R   R   R   R   R   R   Rn  Rp  Ro  RL  Rt  RA  (    (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRP   p   s   			)				
																		!											 			-									
													%							0	#	k												
			c         C   s   t  t |    S(   N(   Rd   R  (   R   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRJ    s    c         C   st   d } } x] |  D]U } | d k r: | d } | d } q | d k re | d } | | d | } q Pq W| | f S(   Ni    R
  i   s   	(    (   t   sR   RM  RN  t   ch(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRK    s    


R}  c           B   s;   e  Z d    Z d   Z e j e j d
 d  Z d	   Z RS(   c         C   s6   | |  _  | |  _ d |  _ |  _ d  |  _ |  _ d  S(   Ni    (   Re   R   R  t   finishedR   t   blkopenlinet   indentedline(   R6   Re   R   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR7   5  s    		c         C   sd   |  j  r d S|  j d } |  _ t |  d } |  j j | d d  rM d S|  j j | | d  S(   NR~  i   s   .0s   >=R}   s    lineend+1c(   R  R  R  Re   R  R   (   R6   R  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR  ;  s    	t   classt   deft   fort   ift   tryt   whilec	   	      C   s^   |  j  r nN | | k r0 | | k r0 | |  _ n* | | k rZ |  j rZ | |  _ d |  _  n  d  S(   Ni   (   R  R  R  (	   R6   Rc   t   tokent   startR}   R  t   INDENTt   NAMEt   OPENERS(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt
   tokeneaterD  s    		c         C   sm   t  j } |  j t  _ z; y t  j |  j |  j  Wn t  j t f k
 rN n XWd  | t  _ X|  j |  j	 f S(   N(
   t	   _tokenizet   tabsizeR   t   tokenizeR  R  t
   TokenErrort   SyntaxErrorR  R  (   R6   t   save_tabsize(    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR0  P  s    	
(   R  R  R  R  R  R  (	   R#   RO   R7   R  R  R  R  R  R0  (    (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR}  .  s   		
	c         C   s>   |  j  d  } | d k r4 |  |  |  | d }  n  | |  f S(   NR  i    i   (   Rv  (   R  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR<  `  s    t   [t   bracketleftt   ]t   bracketrightt   /t   slashc         C   s  |  j  |  } | s7 t j   r; | d d d h k r; d S| d } t j d d   |  } t j d d	   |  } t j d
 d |  } t j d d |  } t j d d |  } t j d d |  } t j d d |  } t j d d |  } t j d d |  } | S(   Ns   <<open-module>>s   <<goto-line>>s   <<change-indentwidth>>R~  i    s   -[a-z]\bc         S   s   |  j    j   S(   N(   t   groupt   upper(   R/   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRo   y  s    s   \b\w+\bc         S   s   t  j |  j   |  j    S(   N(   t   keynamesR   R  (   R/   (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyRo   z  s    s   Key-t   Cancels
   Ctrl-Breaks   Control-s   Ctrl-R  R>   s   ><R
  R  R  (   R   R   R   R  t   sub(   R  RV  R  R  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyR  o  s"    
c         C   sF   |  j  } | j d d d  | j d d d  | j 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_](   Rb  Rc  (   R   Rb  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   fixwordbreaks  s    	c          C   s   t    }  t |   |  j   t j d r: t j d } n d  } t d |  d |  } | j |  j  | j	 j
 d | j  |  j   |  j   d  S(   Ni   R   R,   s   <<close-all-windows>>(   t   TkR  RI   R   t   argvR   RP   R  t   quitRe   RD   R   t   mainloopRE   (   R   R,   R,  (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   test  s    	


t   __main__(*   R   R&   R  R   R  R   R   Rm  t   idlelib.MultiCallR   R  R   R   R   R   R   R   t   idlelib.configHandlerR   R	   R
   R   R   R8  R   R   R2   t   objectR3   Rh  RP   RJ  RK  R  R  R}  R<  R  R  R  R  R#   (    (    (    s,   /usr/lib64/python2.7/idlelib/EditorWindow.pyt   <module>   sX   
	!(	     		2		
				