
]c           @   sN  d  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 e f d     YZ d Z i d d 6Z d   Z d e f d     YZ e d k rJd d l Z e j d d d d e d d l  m! Z! e! e  n  d S(   s  IDLE Configuration Dialog: support user customization of IDLE by GUI

Customize font faces, sizes, and colorization attributes.  Set indentation
defaults.  Customize keybindings.  Colorization and keybindings can be
saved as user defined sets.  Select startup options including shell/editor
and default window size.  Define additional help sources.

Note that tab width in IDLE is currently fixed at eight due to Tk issues.
Refer to comments in EditorWindow autoindent code for details.

i(   t   *N(   t   idleConf(   t   DynOptionMenu(   t   GetKeysDialog(   t   GetCfgSectionNameDialog(   t   GetHelpSourceDialog(   t   TabbedPageSet(   t	   view_text(   t   macosxSupportt   ConfigDialogc           B   s  e  Z d  e e d  Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d    Z" d!   Z# d"   Z$ d#   Z% d$   Z& d%   Z' d&   Z( d'   Z) d(   Z* d)   Z+ d*   Z, d+   Z- d,   Z. dN d-  Z0 d.   Z1 d/   Z2 d0   Z3 d1   Z4 d2   Z5 d3   Z6 d4   Z7 d5   Z8 d6   Z9 d7   Z: d8   Z; d9   Z< d:   Z= d;   Z> d<   Z? d=   Z@ d>   ZA d?   ZB d@   ZC dA   ZD dB   ZE dC   ZF dD   ZG dE   ZH dF   ZI dG   ZJ dH   ZK dI   ZL dJ   ZM dK   ZN dL   ZO dM   ZP RS(O   t    c         C   s  t  j |  |  | |  _ | r+ i  | _ n  |  j   |  j d d  |  j | pT d  |  j d | j   d | j	   | s d n d f  i d6 d
 6d7 d 6d8 d 6d9 d 6d: d 6d; d 6d< d 6d= d 6d> d" 6d? d% 6d@ d( 6dA d+ 6dB d. 6dC d1 6|  _
 |  j   |  j   |  j d2 t d3 t  |  j |  |  j   |  j d4 |  j  |  j j   |  j   |  j   | s|  j   |  j   n  d5 S(D   s   
        _htest - bool, change box location when running htest
        _utest - bool, don't wait_window when running unittest
        t   borderwidthi   s   IDLE Preferencess   +%d+%di   i   i   t   normalt   00s   Normal Textt   keywordt   01s   Python Keywordst
   definitiont   02s   Python Definitionst   builtint   03s   Python Builtinst   commentt   04s   Python Commentst   stringt   05s   Python Stringst   hilitet   06s   Selected Textt   hitt   07s
   Found Textt   cursort   08t   Cursort   breakt   09s   Editor Breakpointt   consolet   10s   Shell Normal Textt   errort   11s   Shell Error Textt   stdoutt   12s   Shell Stdout Textt   stderrt   13s   Shell Stderr Textt   heightt   widtht   WM_DELETE_WINDOWN(   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(   (   t   Toplevelt   __init__t   parentt   instance_dictt   wm_withdrawt	   configuret   titlet   geometryt   winfo_rootxt   winfo_rootyt   themeElementst   ResetChangedItemst   CreateWidgetst	   resizablet   FALSEt	   transientt   grab_sett   protocolt   Cancelt   tabPagest	   focus_sett   LoadConfigst   AttachVarCallbackst   wm_deiconifyt   wait_window(   t   selfR.   R2   t   _htestt   _utest(    (    s%   lib/python2.7/idlelib/configDialog.pyR-      sJ    	
!





c         C   s   t  |  d d d d d d g |  _ |  j j d t d t d	 t  |  j   |  j   |  j   |  j	   |  j
   |  j   j d t  d  S(
   Nt
   page_namess
   Fonts/Tabst   Highlightingt   Keyst   Generalt
   Extensionst   sidet   expandt   fill(   R   R?   t   packt   TOPt   TRUEt   BOTHt   CreatePageFontTabt   CreatePageHighlightt   CreatePageKeyst   CreatePageGeneralt   CreatePageExtensionst   create_action_buttonst   BOTTOM(   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR8   O   s    	




c      
   C   s   t  j   r i  } n i d d 6d d 6} t |  d d } t | d d } xu d |  j f d |  j f d |  j f d	 |  j f f D]= \ } } t | d
 | d | d t | j	 d t
 d d  q Wt | d d d d j	 d t  | j	 d t  | S(   Ni   t   padxi   t   padyi   t   Okt   ApplyR>   t   Helpt   textt   commandt	   takefocusRM   i   R)   R   i    (   R   t   isAquaTkt   FrameR]   R^   R>   R_   t   ButtonR:   RP   t   LEFTRQ   RZ   (   RE   t   paddingArgst   outert   buttonst   txtt   cmd(    (    s%   lib/python2.7/idlelib/configDialog.pyRY   [   s    	"c         C   s  |  j  } t |  |  _ t |  |  _ t |  |  _ t |  |  _ t j	 | d+  |  _
 |  j j d j } t | d d d t d d	 } t | d d d t d d
 } t |  } t |  } t | d t d d } t | d d d t d t |  _ |  j j d |  j  t |  } | j d |  j j  |  j j d | j  t | d d }	 t | |  j d  d |  j |  _ t  | d |  j d d d d d d d |  j }
 t | d t! d d } t | d t d |  j
 d d |  _" t |  } t | d t d d } t# | d |  j d d d  d d! d d" d# |  _$ | j% d$ t d% d d& d d' t& d( t'  | j% d$ t d% d d& d d( t(  | j% d$ t) d% d d& d d( t*  | j% d$ t) d% d d& d d( t*  | j% d$ t) d) t+  |  j j% d$ t d' t& d( t*  | j% d$ t d( t(  |	 j% d$ t d) t+  |  j j% d$ t d) t+  |
 j% d$ t d) t+ d% d*  | j% d$ t) d% d d& d d' t& d( t'  |  j" j% d' t& d( t'  | j% d$ t) d( t*  | j% d$ t) d) t+ d% d  |  j$ j% d$ t) d% d d( t*  | S(,   Nt   courieri
   R   s
   Fonts/TabsR   i   t   reliefR`   s    Base Editor Font s    Indentation Width t   justifys   Font Face :R)   i   Rb   t   exportselections   <ButtonRelease-1>Ra   t   yscrollcommands   Size :t   variablet   onvaluei   t   offvaluei    t   Boldt   fonts,   AaBbCcDdEe
FfGgHhIiJjK
1234567890
#:+=(){}[]s   Python Standard: 4 Spaces!t   orientt
   horizontalt   tickintervalt   from_t   toi   RM   R[   R\   RN   RO   t   anchori   (   Rl   i
   R   (,   R.   t	   StringVart   fontSizet
   BooleanVart   fontBoldt   fontNamet   IntVart   spaceNumt   tkFontt   Fontt   editFontR?   t   pagest   framet
   LabelFramet   GROOVERd   t   LabelRf   t   ListboxR:   t   listFontNamet   bindt   OnListFontButtonReleaset	   Scrollbart   configt   yviewt   setR   t   Nonet   SetFontSamplet   optMenuFontSizet   Checkbuttont   SOLIDt   labelFontSamplet   Scalet   scaleSpaceNumRP   RR   RS   t   YRQ   t   Xt   W(   RE   R.   R   t	   frameFontt   frameIndentt   frameFontNamet   frameFontParamt   labelFontNameTitlet
   scrollFontt   labelFontSizeTitlet   checkFontBoldt   frameFontSamplet   frameIndentSizet   labelSpaceNumTitle(    (    s%   lib/python2.7/idlelib/configDialog.pyRT   p   sn    			("""(c      !   C   sB  |  j  } t |  |  _ t |  |  _ t |  |  _ t |  |  _ t |  |  _ t |  |  _ t |  |  _	 |  j
 j d j } t | d d d t d d } t | d d d t d d } t | d t d d d	 dZ d d d d d d d t d d d t 	|  _ |  j } | j d d    | j d d    d[ d\ d] d^ d_ d` da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz f  } x) | D]! } | j t | d | d  qWx; |  j D]0 } | dA  }	 | j |  j | d dB |	  qW| j dC t  t | d t d d |  _ t |  }
 t |  j d dD dE |  j d d } t |  j |  j	 d  d d |  _! t" |
 dF |  j dG d d dH dE |  j# |  _$ t" |
 dF |  j dG d d dI dE |  j# |  _% |  j j& d  t | d dJ dE |  j' } t( | d dK } t" | dF |  j dG d dE |  j) d dL |  _* t" | dF |  j dG d dE |  j) d dM |  _+ t | |  j d  dE d  |  _, t | |  j d  dE d  |  _- t | d dN dE |  j. |  _/ t( | dO d |  _0 | j1 dP t2 dQ dR dS dR dT t3 dU t4  | j1 dP t2 dQ dR dS dR dU t5  |  j j1 dP t6 dQ dR dS dR dT t3 dU t7  |
 j1 dP t6 dQ dR dS d  |  j j1 dP t6 dQ dR dS dR dT t3 dU t4  | j1 dP t6 dT t3 dU t7 dQ dV dS dW  |  j! j1 dP t6 dT t3 dU t7 dQ dV dS dX  |  j$ j1 dP t2 dY t8  |  j% j1 dP t9 dY t:  | j1 dP t; dU t7 dQ dR dS dR  | j1 dP t6 dY t: dQ dR dS dR  |  j* j1 dP t6 dY t: dQ dR  |  j+ j1 dP t6 dY t: dQ dR dS d  |  j, j1 dP t6 dU t7 dQ dR dS dR  |  j- j1 dP t6 dU t7 dY t: dQ dR dS dR  |  j/ j1 dP t6 dU t7 dQ dR dS dR  |  j0 j1 dP t6 dU t7 dS dR  | S({   NRI   R   i   Rm   R`   s    Custom Highlighting s    Highlighting Theme i   Ru   Rl   i   R
   R   t   hand2R*   i   R)   i   Rb   t   highlightthicknessi    t   wraps   <Double-Button-1>c         S   s   d S(   NR   (    (   t   e(    (    s%   lib/python2.7/idlelib/configDialog.pyt   <lambda>   R
   s   <B1-Motion>c         S   s   d S(   NR   (    (   R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR      R
   s   #you can click hereR   s   
R   s   #to choose itemst   defR   t    t   funcR   s   (param):
  s   """string"""R   s
   
  var0 = s   'string's
   
  var1 = s
   'selected'R   s
   
  var2 = s   'found'R   s
   
  var3 = t   listR   t   (R   s   )
s     breakpoint("line")R   s   

s    error R#   s   cursor |s   
 t   shellR!   R%   R'   c         S   s   |  j  j   j j |  d  S(   N(   t   widgett   winfo_toplevelt   highlightTargetR   (   t   eventt   elem(    (    s%   lib/python2.7/idlelib/configDialog.pyt   tem   s    s   <ButtonPress-1>t   states   Choose Colour for :Ra   Rq   t   valuet
   Foregroundt
   Backgrounds   Save as New Custom Themes	   Select : s   a Built-in Themes   a Custom Themes   Delete Custom Themet   bdRM   R[   i   R\   RN   RO   i   i   i   R{   (   Rl   i   R
   (   s   #you can click hereR   (   s   
R   (   s   #to choose itemsR   (   s   
R   (   R   R   (   R   R   (   R   R   (   s   (param):
  R   (   s   """string"""R   (   s
   
  var0 = R   (   s   'string'R   (   s
   
  var1 = R   (   s
   'selected'R   (   s
   
  var2 = R   (   s   'found'R   (   s
   
  var3 = R   (   R   R   (   R   R   (   R   R   (   s   )
R   (   s     breakpoint("line")R   (   s   

R   (   s    error R#   (   R   R   (   s   cursor |R   (   s   
 R   (   R   R!   (   R   R   (   R%   R%   (   R   R   (   R'   R'   (   s   
R   (<   R.   R|   t   builtinThemet   customThemeR~   t   fgHilitet   colourR   t   themeIsBuiltinR   R?   R   R   R   R   t   TextR   R:   t   NONEt   textHighlightSampleR   t   insertt   ENDR6   t   tag_bindR   t   DISABLEDRd   t   frameColourSetRe   t	   GetColourR   R   t   optMenuHighlightTargett   Radiobuttont   SetColourSampleBindingt   radioFgt   radioBgR   t   SaveAsNewThemeR   t   SetThemeTypet   radioThemeBuiltint   radioThemeCustomt   optMenuThemeBuiltint   optMenuThemeCustomt   DeleteCustomThemet   buttonDeleteCustomThemet   new_custom_themeRP   Rf   RR   RS   R   RQ   R   t   Et   RIGHTR   RZ   (   RE   R.   R   t   frameCustomt
   frameThemeR`   t   textAndTagst   txTat   elementR   t	   frameFgBgt   buttonSetColourt   buttonSaveCustomThemet   labelTypeTitle(    (    s%   lib/python2.7/idlelib/configDialog.pyRU      s    				("+(""%%+%c         C   s  |  j  } t |  |  _ t |  |  _ t |  |  _ t |  |  _ t |  |  _ |  j j	 d j
 } t | d d d t d d } t | d d d t d d } t |  } t | d d } t |  } t | d	 t } t | d
 t d t |  _ |  j j d |  j  | j d |  j j  | j d |  j j  |  j j d | j  |  j j d | j  t | d d d |  j d t |  _ g  t d  D]$ }	 t | d d d d d d ^ q}
 t |
 d d |  j d d d |  j  d d |  _! t |
 d d |  j d d d |  j  d d |  _" t# |
 d |  j d  d d  |  _% t# |
 d |  j d  d d  |  _& t |
 d d d d |  j' |  _( t |
 d d d d |  j) } | j* d t+ d d d d d t, d t-  | j* d t+ d d d d d t-  |  j j* d t+ d t. d d d d  | j* d t/ d d d d d t, d t-  | j0 d d  d | j1 d d  d | j2 d! d d" d d# d d$ t3  |  j j2 d! d d" d d$ t4  | j2 d! d d" d d$ t5  | j2 d! d d" d d$ t6  |  j! j2 d! d d" d d$ t3 t5  |  j" j2 d! d d" d d$ t3 t5  |  j% j2 d! d d" d d$ t4  |  j& j2 d! d d" d d$ t4  |  j( j* d t/ d t. d t7 d d  | j* d t/ d t. d t7 d d  |
 d j* d t8 d t- d t7  |
 d j* d t8 d t. d t7 d d  | S(%   NRJ   R   i   Rm   R`   s    Custom Key Bindings s	    Key Set s   Action - Key(s)Rv   Rb   Ro   s   <ButtonRelease-1>Ra   Rp   t   xscrollcommands   Get New Keys for SelectionR   R[   R\   i    Rq   R   i   s   Use a Built-in Key Sets   Use a Custom Key Sets   Delete Custom Key Sets   Save as New Custom Key SetRM   i   RN   RO   t   weightt   rowt   columnt
   columnspant   sticky(9   R.   R|   t   bindingTargett   builtinKeyst
   customKeysR~   t   keysAreBuiltint
   keyBindingR?   R   R   R   R   Rd   R   R   t
   HORIZONTALR   R:   t   listBindingsR   t   KeyBindingSelectedR   R   t   xviewR   Re   t
   GetNewKeysR   t   buttonNewKeyst   rangeR   t   SetKeysTypet   radioKeysBuiltint   radioKeysCustomR   R   t   optMenuKeysBuiltint   optMenuKeysCustomt   DeleteCustomKeyst   buttonDeleteCustomKeyst   SaveAsNewKeySetRP   RZ   RR   RS   R   Rf   t   columnconfiguret   rowconfiguret   gridR   t   NSEWt   NSt   EWt   TrueRQ   (   RE   R.   R   R   t   frameKeySetst   frameTargett   labelTargetTitlet   scrollTargetYt   scrollTargetXt   it   framest   buttonSaveCustomKeys(    (    s%   lib/python2.7/idlelib/configDialog.pyRV   #  s~    		4("%("##%" &c         C   s1  |  j  } t |  |  _ t |  |  _ t |  |  _ t |  |  _ t |  |  _ t |  |  _	 t |  |  _
 |  j j d j } t | d d d t d d } t | d d d t d d } t | d d d t } t | d d d t } t | d d d t d d } t | d d	 } t | d
 |  j d d d |  j d d }	 t | d
 |  j d d d |  j d d }
 t | d d } t | d
 |  j d d d |  j d d } t | d
 |  j d d d |  j d d } t | d d } t | d d } t | d |  j d d } t | d d } t | d |  j d d } t | d d } t | d
 |  j d d d d } t | d
 |  j d d d d } t | d
 |  j d d d d  } t |  } t |  } t |  } t | d! d" d# t d$ t |  _ | j d |  j j  |  j j d% | j  |  j j d& |  j  t | d d' d( t d d) d |  j  |  _! t | d d* d d) d |  j" |  _# t | d d+ d( t d d) d |  j$ |  _% | j& d, t' d- d" d. d" d/ t(  | j& d, t' d- d" d. d" d/ t(  | j& d, t' d- d" d. d" d/ t(  | j& d, t' d- d" d. d" d/ t(  | j& d, t' d- d" d. d" d0 t) d/ t*  | j& d, t+ d1 t, d- d" d. d"  |
 j& d, t- d1 t, d- d" d. d"  |	 j& d, t- d1 t, d- d" d. d"  | j& d, t+ d1 t, d- d" d. d"  | j& d, t- d1 t, d- d" d. d"  | j& d, t- d1 t, d- d" d. d"  | j& d, t+ d1 t, d- d" d. d"  | j& d, t- d1 t. d- d2 d. d"  | j& d, t- d1 t. d. d"  | j& d, t- d1 t. d- d2 d. d"  | j& d, t- d1 t. d. d"  | j& d, t+ d1 t, d- d" d. d"  | j& d, t- d1 t. d. d"  | j& d, t- d1 t. d. d"  | j& d, t- d1 t. d. d"  | j& d, t- d- d" d. d" d/ t/  | j& d, t' d- d" d. d" d0 t) d/ t*  | j& d, t- d1 t, d/ t/  |  j j& d, t+ d1 t. d0 t) d/ t*  |  j! j& d, t' d1 t, d. d"  |  j# j& d, t' d1 t,  |  j% j& d, t' d1 t, d. d"  | S(3   NRK   R   i   Rm   R`   s    Startup Preferences s    Autosave Preferences s    Additional Help Sources s
   At StartupRq   R   i   Ra   s   Open Edit Windowi    s   Open Shell Windows   At Start of Run (F5)  s   Prompt to Saves	   No Prompts$   Initial Window Size  (in characters)t   Widtht   textvariableR*   i   t   Heights   Default Source Encodingt   locales   Locale-defineds   utf-8s   UTF-8t   noneR   R)   i   Rb   Ro   Rp   s   <ButtonRelease-1>t   EditR   i   t   Addt   RemoveRM   R[   R\   RO   RN   R{   i
   (0   R.   R|   t   winWidtht	   winHeightR   t   startupEditt   autoSavet   encodingR~   t   userHelpBrowsert   helpBrowserR?   R   R   R   R   Rd   R   R   R   t   EntryR   R   R:   t   listHelpR   R   R   R   t   HelpSourceSelectedRe   R   t   HelpListItemEditt   buttonHelpListEditt   HelpListItemAddt   buttonHelpListAddt   HelpListItemRemovet   buttonHelpListRemoveRP   RQ   R   RR   RS   Rf   R   R   R   R   (   RE   R.   R   t   frameRunt	   frameSavet   frameWinSizet   frameEncodingt	   frameHelpt   labelRunChoiceTitlet   radioStartupEditt   radioStartupShellt   labelRunSaveTitlet   radioSaveAskt   radioSaveAutot   labelWinSizeTitlet   labelWinWidthTitlet   entryWinWidtht   labelWinHeightTitlet   entryWinHeightt   labelEncodingTitlet   radioEncLocalet   radioEncUTF8t   radioEncNonet   frameHelpListt   frameHelpListButtonst   scrollHelpList(    (    s%   lib/python2.7/idlelib/configDialog.pyRW   p  s    				""""("""""""""""(%c         C   s  |  j  j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j	 j d |  j
  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j  |  j j d |  j   |  j! j d |  j"  d  S(   Nt   w(#   R}   t   trace_variablet   VarChanged_fontR   R   R   t   VarChanged_spaceNumR   t   VarChanged_colourR   t   VarChanged_builtinThemeR   t   VarChanged_customThemeR   t   VarChanged_themeIsBuiltinR   t   VarChanged_highlightTargetR   t   VarChanged_keyBindingR   t   VarChanged_builtinKeysR   t   VarChanged_customKeysR   t   VarChanged_keysAreBuiltinR  t   VarChanged_winWidthR  t   VarChanged_winHeightR  t   VarChanged_startupEditR  t   VarChanged_autoSaveR  t   VarChanged_encoding(   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyRB     s$    c         C   s   x |  j  |  j |  j |  j |  j |  j |  j |  j |  j |  j	 |  j
 |  j |  j |  j |  j |  j |  j |  j f D]$ } | j d | j   d d  qs Wd  S(   NR>  i    i   (   R}   R   R   R   R   R   R   R   R   R   R   R   R   R  R  R  R  R  t   trace_vdeletet   trace_vinfo(   RE   t   var(    (    s%   lib/python2.7/idlelib/configDialog.pyt   remove_var_callbacks  s    c         G   ss   |  j  j   } |  j d d d |  |  j j   } |  j d d d |  |  j j   } |  j d d d |  d S(   s   When one font attribute changes, save them all, as they are
        not independent from each other. In particular, when we are
        overriding the default font, we need to write out everything.
        t   maint   EditorWindowRu   s	   font-sizes	   font-boldN(   R   t   gett   AddChangedItemR}   R   (   RE   t   paramsR   (    (    s%   lib/python2.7/idlelib/configDialog.pyR@    s    c         G   s)   |  j  j   } |  j d d d |  d  S(   NRT  t   Indents
   num-spaces(   R   RV  RW  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRA    s    c         G   s   |  j    d  S(   N(   t   OnNewColourSet(   RE   RX  (    (    s%   lib/python2.7/idlelib/configDialog.pyRB    s    c         G   s   |  j  j   } | d k r t j d d d  d k rO |  j d d d d  n  |  j d d d |  |  j j d d	 d
 d  nE |  j d d d |  |  j d d d d  |  j j d d d
 d  |  j   d  S(   Ns	   IDLE DarkRT  t   Themet   names   IDLE News   IDLE Classict   name2R`   s   New theme, see Helpt   fgs   #500000R
   t   black(   R   RV  R   t	   GetOptionRW  R   R   t   PaintThemeSample(   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRC    s    
c         G   sB   |  j  j   } | d k r> |  j d d d |  |  j   n  d  S(   Ns   - no custom themes -RT  R[  R\  (   R   RV  RW  Ra  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRD  "  s    c         G   sF   |  j  j   } |  j d d d |  | r8 |  j   n
 |  j   d  S(   NRT  R[  t   default(   R   RV  RW  RC  RD  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRE  (  s
    c         G   s   |  j    d  S(   N(   t   SetHighlightTarget(   RE   RX  (    (    s%   lib/python2.7/idlelib/configDialog.pyRF  0  s    c         G   s   |  j  j   } |  j j   } |  j j t  j   d } t j |  rb |  j d | | |  n/ t j	 |  } | d } |  j d | | |  d  S(   Ni    t   keyst   _cfgBindingst
   extensions(
   R   RV  R   R   t   ANCHORt   splitR   t   IsCoreBindingRW  t   GetExtnNameForEvent(   RE   RX  R   t   keySetR   t   extNamet   extKeybindSection(    (    s%   lib/python2.7/idlelib/configDialog.pyRG  3  s    
c         G   s6   |  j  j   } |  j d d d |  |  j |  d  S(   NRT  RJ   R\  (   R   RV  RW  t   LoadKeysList(   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRH  ?  s    c         G   sE   |  j  j   } | d k rA |  j d d d |  |  j |  n  d  S(   Ns   - no custom keys -RT  RJ   R\  (   R   RV  RW  Rn  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRI  D  s    c         G   sF   |  j  j   } |  j d d d |  | r8 |  j   n
 |  j   d  S(   NRT  RJ   Rb  (   R   RV  RW  RH  RI  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRJ  J  s
    c         G   s)   |  j  j   } |  j d d d |  d  S(   NRT  RU  R*   (   R  RV  RW  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRK  R  s    c         G   s)   |  j  j   } |  j d d d |  d  S(   NRT  RU  R)   (   R  RV  RW  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRL  V  s    c         G   s)   |  j  j   } |  j d d d |  d  S(   NRT  RK   s   editor-on-startup(   R  RV  RW  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRM  Z  s    c         G   s)   |  j  j   } |  j d d d |  d  S(   NRT  RK   t   autosave(   R  RV  RW  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRN  ^  s    c         G   s)   |  j  j   } |  j d d d |  d  S(   NRT  RU  R  (   R  RV  RW  (   RE   RX  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyRO  b  s    c         C   s)   i i  d 6i  d 6i  d 6i  d 6|  _  d  S(   NRT  t	   highlightRd  Rf  (   t   changedItems(   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR7   f  s    c         C   sL   t  |  } | |  j | k r3 i  |  j | | <n  | |  j | | | <d  S(   N(   t   strRq  (   RE   t   typt   sectiont   itemR   (    (    s%   lib/python2.7/idlelib/configDialog.pyRW  o  s    c         C   s   i i  d 6i  d 6i  d 6i  d 6} x | D] } t  j d |  } xh | D]` } i  | | | <t  j | j |  } x3 | D]+ } t  j | j | |  | | | | <qy WqH Wq) W| S(   NRT  Rp  Rd  Rf  Rb  (   R   t   GetSectionListt
   defaultCfgt   GetOptionListt   Get(   RE   t   dItemst
   configTypet   sectionsRt  t   optionst   option(    (    s%   lib/python2.7/idlelib/configDialog.pyt   GetDefaultItemsu  s    "1c         C   s   |  j  j   rK |  j j d t  |  j j d t  |  j j d t  nL |  j j d t  |  j j d t  |  j j d t  |  j j d t  d  S(   NR   (	   R   RV  R   R   t   NORMALR   R   R   R   (   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR     s    c         C   s   |  j  j   rK |  j j d t  |  j j d t  |  j j d t  nL |  j j d t  |  j j d t  |  j j d t  |  j j d t  d  S(   NR   (	   R   RV  R   R   R  R   R   R   R   (   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR     s    c         C   s  |  j  j t  } |  j  j |  } | j   d } |  j j   rU |  j j   } n |  j j   } t j	   } | |  j
 d k r |  j
 d | } x% | D] } | | j   | | <q Wn  | j   } t |  d | |  j }	 |	 r|  j j   rDd }
 |  j |
  } | s4|  j  j |  |  j  j |  d  S|  j |  n  |  j  j |  |  j  j | | d |	  |  j  j |  |  j  j |  |  j j |	  n  |  j  j |  |  j  j |  d  S(   Ni    Rd  s   Get New Keyssc   Your changes will be saved as a new Custom Key Set. Enter a name for your new Custom Key Set below.s    - (   R   t   indexRg  RV  Rh  R   R   R   R   t   GetCurrentKeySetRq  t   valuesR   t   resultt   GetNewKeysNamet
   select_sett   select_anchort   CreateNewKeySett   deleteR   R   R   (   RE   t	   listIndext   bindingt   bindNamet   currentKeySetNamet   currentBindingst   keySetChangesR   t   currentKeySequencest   newKeyst   messaget	   newKeySet(    (    s%   lib/python2.7/idlelib/configDialog.pyR     s<    c         C   s>   t  j d d  t  j d d  } t |  d | |  j } | S(   Nt   userRd  Rb  s   New Custom Key Set(   R   Rv  R   R  (   RE   R  t	   usedNamesR  (    (    s%   lib/python2.7/idlelib/configDialog.pyR    s
    c         C   s)   |  j  d  } | r% |  j |  n  d  S(   Ns   New Key Set Name:(   R  R  (   RE   t   newKeysName(    (    s%   lib/python2.7/idlelib/configDialog.pyR     s    c         C   s   |  j  j d t  d  S(   NR   (   R   R   R  (   RE   R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR     s    c   
      C   s#  |  j  j   r! |  j j   } n |  j j   } t j |  } i  } x8 | D]0 } | d d !} d j | |  } | | | <qL W| |  j d k r |  j d | } x | D] } | | | | <q Wn  |  j | |  t j	 d d  }	 |	 j
   |  j j |	 |  |  j  j d  |  j   d  S(   Ni   iR   Rd  R  i    (   R   RV  R   R   R   t   GetCoreKeyst   joinRq  t   SaveNewKeySetRv  t   sortR   t   SetMenuR   R   (
   RE   t   newKeySetNamet   prevKeySetNamet   prevKeysR  R   t	   eventNameR  R  t   customKeyList(    (    s%   lib/python2.7/idlelib/configDialog.pyR    s&    
c   	      C   s<  d } d } |  j  j   r6 d } |  j  j t  } n  t j |  } | j   } | j   |  j  j d t	  x | D] } d j
 | |  } | d d !} | |  j d k r | |  j d | k r |  j d | | } q n  |  j  j t	 | d |  qu W| r8|  j  j |  |  j  j |  |  j  j |  n  d  S(   Ni    i   R   i   iRd  s    - (   R   t   curselectionR  Rg  R   t	   GetKeySetRd  R  R  R   R  Rq  R   t   seeR  R  (	   RE   t
   keySetNamet   reselectR  R  Rk  t	   bindNamesR  t   key(    (    s%   lib/python2.7/idlelib/configDialog.pyRn    s(    
c         C   sR  |  j  j   } d } t j d | | d |  s5 d  S|  j   t j d j |  | |  j d k rw |  j d | =n  t j d j	   t j
 d d  } | j   | s |  j j d t  |  j j | d  n |  j j | | d  |  j j t j d	 j d
 d   |  j j t j d	 j d
 d   |  j   |  j   |  j   d  S(   Ns0   Are you sure you wish to delete the key set %r ?s   Delete Key SetR.   Rd  R  R   s   - no custom keys -i    RT  RJ   Rb  R\  (   R   RV  t   tkMessageBoxt   askyesnot   DeactivateCurrentConfigR   t   userCfgt   remove_sectionRq  t   SaveRv  R  R   R   R   R   R  R   R   Rw  Ry  R   t   SaveAllChangedConfigst   ActivateConfigChangesR   (   RE   R  t   delmsgt   itemList(    (    s%   lib/python2.7/idlelib/configDialog.pyR     s*    

##

c         C   sR  |  j  j   } d } t j d | | d |  s5 d  S|  j   t j d j |  | |  j d k rw |  j d | =n  t j d j	   t j
 d d  } | j   | s |  j j d t  |  j j | d  n |  j j | | d  |  j j t j d	 j d
 d   |  j j t j d	 j d
 d   |  j   |  j   |  j   d  S(   Ns.   Are you sure you wish to delete the theme %r ?s   Delete ThemeR.   Rp  R  R   s   - no custom themes -i    RT  R[  Rb  R\  (   R   RV  R  R  R  R   R  R  Rq  R  Rv  R  R   R   R   R   R  R   R   Rw  Ry  R   R  R  R   (   RE   t	   themeNameR  R  (    (    s%   lib/python2.7/idlelib/configDialog.pyR     s*    

##

c         C   s   |  j  j   } |  j j d  } t j d |  d d | d |  \ } } | r | | k r |  j j   r d } |  j |  } | s d  S|  j |  |  j	 j
 |  q |  j	 j
 |  n  d  S(   Nt   bgR.   R2   s   Pick new colour for : t   initialcolors_   Your changes will be saved as a new Custom Theme. Enter a name for your new Custom Theme below.(   R   RV  R   t   cgett   tkColorChoosert   askcolorR   t   GetNewThemeNamet   CreateNewThemeR   R   (   RE   t   targett
   prevColourt	   rgbTuplett   colourStringR  t   newTheme(    (    s%   lib/python2.7/idlelib/configDialog.pyR   6  s    	c         C   s   |  j  j   } |  j j d |  |  j j   r7 d n d } |  j |  j j   d } |  j j | i | | 6 |  j	 j   } | d | } |  j
 d | | |  d  S(   NR  t
   foregroundt
   backgroundi    t   -Rp  (   R   RV  R   R   R   R6   R   R   t
   tag_configR   RW  (   RE   t	   newColourt   planet   sampleElementt   themet   themeElement(    (    s%   lib/python2.7/idlelib/configDialog.pyRZ  J  s    c         C   s>   t  j d d  t  j d d  } t |  d | |  j } | S(   NR  Rp  Rb  s   New Custom Theme(   R   Rv  R   R  (   RE   R  R  R  (    (    s%   lib/python2.7/idlelib/configDialog.pyR  T  s
    c         C   s)   |  j  d  } | r% |  j |  n  d  S(   Ns   New Theme Name:(   R  R  (   RE   t   newThemeName(    (    s%   lib/python2.7/idlelib/configDialog.pyR   [  s    c         C   s   |  j  j   r' d } |  j j   } n d } |  j j   } t j | |  } | |  j d k r |  j d | } x | D] } | | | | <qy Wn  |  j | |  t j d d  } | j	   |  j
 j | |  |  j  j d  |  j   d  S(   NRb  R  Rp  i    (   R   RV  R   R   R   t   GetThemeDictRq  t   SaveNewThemeRv  R  R   R  R   R   (   RE   R  t	   themeTypeR  R  t   themeChangesR   t   customThemeList(    (    s%   lib/python2.7/idlelib/configDialog.pyR  `  s     
c         C   s6   |  j  j t  } |  j j | j    |  j   d  S(   N(   R   RV  Rg  R   R   t   lowerR   (   RE   R   Ru   (    (    s%   lib/python2.7/idlelib/configDialog.pyR   x  s    c         C   sr   |  j  j   } |  j j   r' t j n t j } | |  j j   | f } |  j j d |  |  j	 j
 d |  d  S(   NRu   (   R   RV  R   R   t   BOLDR  R}   R   R   R   R1   (   RE   R   R   t
   fontWeightt   newFont(    (    s%   lib/python2.7/idlelib/configDialog.pyR   }  s
    !c         C   s   |  j  j   d k rN |  j j d t  |  j j d t  |  j j d  n6 |  j j d t  |  j j d t  |  j j d  |  j	   d  S(   NR   R   i   (
   R   RV  R   R   R   R   R   R   R  t   SetColourSample(   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyRc    s    c         G   s   |  j    d  S(   N(   R  (   RE   t   args(    (    s%   lib/python2.7/idlelib/configDialog.pyR     s    c         C   sa   |  j  |  j j   d } |  j j   r/ d n d } |  j j | |  } |  j j d |  d  S(   Ni    R  R  R  (   R6   R   RV  R   R   t   tag_cgetR   R   (   RE   t   tagR  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR    s    c         C   s$  |  j  j   r! |  j j   } n |  j j   } x |  j D] } |  j | d } t j | |  } | d k r t j | d d d | d <n  | |  j d k r |  j d | } | d | k r | | d | d	 <n  | d
 | k r | | d
 | d <q n  |  j j	 | |  q: W|  j
   d  S(   Ni    R   R   t   fgBgR  R  Rp  s   -foregroundR  s   -background(   R   RV  R   R   R6   R   t   GetHighlightRq  R   R  R  (   RE   R  t   elementTitleR   t   colourst	   themeDict(    (    s%   lib/python2.7/idlelib/configDialog.pyRa    s"    c         C   s   |  j    d  S(   N(   t   SetHelpListButtonStates(   RE   R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR     s    c         C   s   |  j  j   d k  r> |  j j d t  |  j j d t  n^ |  j  j   rv |  j j d t  |  j j d t  n& |  j j d t  |  j j d t  d  S(   Ni   R   (   R  t   sizeR"  R   R   R&  R  R  (   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR    s    c         C   sh   t  |  d  j } | rZ |  j j | d | d f  |  j j t | d  |  j   n  |  j   d  S(   Ns   New Help Sourcei    i   (	   R   R  t   userHelpListt   appendR  R   R   t   UpdateUserHelpChangedItemsR  (   RE   t
   helpSource(    (    s%   lib/python2.7/idlelib/configDialog.pyR#    s    c         C   s   |  j  j t  } |  j | } t |  d d | d d | d j } | sX | | k r\ d  S| |  j | <|  j  j |  |  j  j | | d  |  j   |  j	   d  S(   Ns   Edit Help Sourcet   menuItemi    t   filePathi   (
   R  R  Rg  R  R   R  R  R   R  R  (   RE   t	   itemIndexR  t   newHelpSource(    (    s%   lib/python2.7/idlelib/configDialog.pyR!    s    
c         C   sD   |  j  j t  } |  j | =|  j  j |  |  j   |  j   d  S(   N(   R  R  Rg  R  R  R  R  (   RE   R  (    (    s%   lib/python2.7/idlelib/configDialog.pyR%    s
    

c      	   C   sp   i  |  j  d d <xX t d t |  j  d  D]: } |  j d d t |  d j |  j | d d    q. Wd S(   s<   Clear and rebuild the HelpFiles section in self.changedItemsRT  t	   HelpFilesi   t   ;i   N(   Rq  R   t   lenR  RW  Rr  R  (   RE   t   num(    (    s%   lib/python2.7/idlelib/configDialog.pyR    s
    #c   
      C   s9  t  t j |    } | j   x! | D] } |  j j t |  q& Wt j |  d d  } | d j	   } | d } | d d k } |  j
 j |  g  | D] } | j	   ^ q } yC | j |  }	 |  j j |	  |  j j |	  |  j j |	  Wn t k
 rn X|  j j d |  |  j j |  |  j   d  S(   NRT  RU  i    i   i   t   boldt   7t   8t   9R"   R$   R&   R(   t   14t   16t   18t   20t   22t   25t   29t   34t   40(   R  R  R  R"   R$   R&   R(   R  R  R  R  R  R  R  R  R  (   R   R   t   familiesR  R   R   R   R   t   GetFontR  R   R   R  R  R  R  t
   ValueErrorR   R  R   R   (
   RE   t   fontsRu   t   configuredFontR   R}   R   t   st   lc_fontst   currentFontIndex(    (    s%   lib/python2.7/idlelib/configDialog.pyt   LoadFontCfg  s,    

	 
c         C   s5   t  j d d d d d d d } |  j j |  d  S(   NRT  RY  s
   num-spacesRb  i   t   typet   int(   R   R`  R   R   (   RE   R   (    (    s%   lib/python2.7/idlelib/configDialog.pyt
   LoadTabCfg  s    c      	      s    j  j t j d d d d d d d  t j   }   j  j   r t j d d  } | j     j j	 | |  t j d d  } | j   | s   j
 j d	 t    j j d
  q9  j j	 | | d  nb t j d d  } | j     j j	 | |  t j d d  } | j     j j	 | | d    j     j j   } | j d   f d      j j	 | | d    j     j   d  S(   NRT  R[  Rb  R  t   booli   Rp  R  R   s   - no custom themes -i    R  c            s     j  |  d S(   Ni   (   R6   (   t   x(   RE   (    s%   lib/python2.7/idlelib/configDialog.pyR      R
   (   R   R   R   R`  t   CurrentThemeRV  Rv  R  R   R  R   R   R   R   R   R   R6   Rd  R   Ra  Rc  (   RE   t   currentOptionR  t
   themeNames(    (   RE   s%   lib/python2.7/idlelib/configDialog.pyt   LoadThemeCfg  s2    





c      	   C   s`  |  j  j t j d d d d d d d  t j   } |  j  j   r t j d d  } | j   |  j j	 | |  t j d d  } | j   | s |  j
 j d	 t  |  j j d
  q9|  j j	 | | d  nb t j d d  } | j   |  j j	 | |  t j d d  } | j   |  j j	 | | d  |  j   t j   } |  j |  d  S(   NRT  RJ   Rb  R  R  i   Rd  R  R   s   - no custom keys -i    (   R   R   R   R`  t   CurrentKeysRV  Rv  R  R   R  R   R   R   R   R   R   Rn  (   RE   R  R  R  (    (    s%   lib/python2.7/idlelib/configDialog.pyt
   LoadKeyCfg%  s,    




c      	   C   s  |  j  j t j d d d d d d d  |  j j t j d d d d d	 d d  |  j j t j d d
 d d d  |  j j t j d d
 d d d  |  j j t j d d
 d d d  t j   |  _	 x( |  j	 D] } |  j
 j t | d	  q W|  j   d  S(   NRT  RK   s   editor-on-startupRb  i   R  R  Ro  i    RU  R*   R   R)   R  R  (   R  R   R   R`  R  R  R  R  t   GetAllExtraHelpSourcesListR  R  R   R   R  (   RE   t   helpItem(    (    s%   lib/python2.7/idlelib/configDialog.pyt   LoadGeneralCfgC  s    c         C   s6   |  j    |  j   |  j   |  j   |  j   d S(   s   
        load configuration from default and user config files and populate
        the widgets on the config dialog pages.
        N(   R  R  R  R	  R  (   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyRA   X  s
    



c         C   sf   t  j d j |  s- t  j d j |  n  x2 | D]* } | | } t  j d j | | |  q4 Wd S(   s   
        save a newly created core key set.
        keySetName - string, the name of the new key set
        keySet - dictionary containing the new key set
        Rd  N(   R   R  t   has_sectiont   add_sectiont	   SetOption(   RE   R  Rk  R   R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR  h  s
    
c         C   sf   t  j d j |  s- t  j d j |  n  x2 | D]* } | | } t  j d j | | |  q4 Wd S(   s   
        save a newly created theme.
        themeName - string, the name of the new theme
        theme - dictionary containing the new theme
        Rp  N(   R   R  R  R  R  (   RE   R  R  R   R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR  t  s
    
c         C   sl   t  j | j | |  rR t  j | j | |  | k rR t  j | j | |  Sn  t  j | j | | |  S(   N(   R   Rw  t
   has_optionRy  R  t   RemoveOptionR  (   RE   R{  Rt  Ru  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyt   SetUserValue  s    c         C   s  t  j d j   x |  j D] } t } x |  j | D] } | d k rd t  j d j d  t } n  xO |  j | | D]< } |  j | | | } |  j | | | |  rv t } qv qv Wq5 W| r t  j | j   q q Wx% d d g D] } t  j | j   q W|  j   |  j	   d S(   s3   Save configuration changes to the user config file.RT  R  Rd  Rp  N(
   R   R  R  Rq  t   FalseR  R  R  R7   t   save_all_changed_extensions(   RE   R{  t   cfgTypeHasChangesRt  Ru  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyR    s"    	
c         C   s+   |  j  j } x | D] } | j   q Wd  S(   N(   R.   R/   t   RemoveKeybindings(   RE   t   winInstancest   instance(    (    s%   lib/python2.7/idlelib/configDialog.pyR    s    c         C   sY   |  j  j j   } x@ | D]8 } | j   | j   | j   | j   | j   q Wd S(   s'   Dynamically apply configuration changesN(   R.   R/   Rd  t   ResetColorizert	   ResetFontt   set_notabs_indentwidtht   ApplyKeybindingst   reset_help_menu_entries(   RE   R  R  (    (    s%   lib/python2.7/idlelib/configDialog.pyR    s    



c         C   s   |  j    |  j   d  S(   N(   t   grab_releaset   destroy(   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR>     s    
c         C   s"   |  j    |  j   |  j   d  S(   N(   R^   R  R  (   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR]     s    

c         C   s"   |  j    |  j   |  j   d  S(   N(   R  R  R  (   RE   (    (    s%   lib/python2.7/idlelib/configDialog.pyR^     s    

c      	   C   s6   |  j  j } t |  d d d t t j | d  d  S(   NR2   s   Help for IDLE preferencesR`   R
   (   R?   t   _current_pageR   t   help_commont
   help_pagesRV  (   RE   t   page(    (    s%   lib/python2.7/idlelib/configDialog.pyR_     s    c      
   C   s  |  j  } |  j j d j } t j d |  _ t j d |  _ |  j	 t
  |  _
 |  j   t |   |  _ | j d d d | j d d d t | d |  j d d	 |  _ |  j j d
 |  j  t | d |  j j } | j |  j _ t | d d d d |  _ |  j j d d d d d d  | j d d d d d d  |  j j d d d d d d d d d g  | j d d d d  i  |  _ d |  _ |  |  _ |  j |  _  d } x6 t! |  j"  D]% } |  j# |  | d | d } qW|  j j |  |  j j$ d  |  j d  d S(   s  Part of the config dialog used for configuring IDLE extensions.

        This code is generic - it works for any and all IDLE extensions.

        IDLE extensions save their configuration options using idleConf.
        This code reads the current configuration using idleConf, supplies a
        GUI interface to change the configuration values, and saves the
        changes using idleConf.

        Not all changes take effect immediately - some may require restarting IDLE.
        This depends on each extension's implementation.

        All values are treated as text, and it is up to the user to supply
        reasonable values. The only exception to this are the 'enable*' options,
        which are boolean, and can be toggled with a True/False button.
        RL   Rf  i    R   i   i   t   listvariablet
   selectmodet   browses   <<ListboxSelect>>Ra   R*   i   R)   R   R   R   t   nwst   nst   nsewR[   i
   R\   R
   t   {s   } N(%   R.   R?   R   R   R   Rw  t   ext_defaultCfgR  t   ext_userCfgt   registert   is_intt   load_extensionsR|   t   extension_namesR  R   R   t   extension_listR   t   extension_selectedR   R   R   Rp   R   t   details_frameR  R1   t   config_frameR   t   current_extensiont
   outerframet   tabbed_page_sett   sortedRf  t   create_extension_framet   selection_set(   RE   R.   R   t   scrollt	   ext_namest   ext_name(    (    s%   lib/python2.7/idlelib/configDialog.pyRX     s<    	
+			c   
      C   s  i  |  _  x' t j d t  D] } g  |  j  | <q Wx|  j  D]} t |  j j |   } g  | D] } | j d  rb | ^ qb } x | D] } | j |  q W| | } x0| D](} |  j j	 | | d t
 } y" i t
 d 6t d 6| } d } WnG t k
 r>y t |  } d } Wq?t k
 r:| } d } q?Xn Xy+ |  j j	 | | d | d t
 d	 | } Wn t k
 r| } n Xt |   }	 |	 j t |   |  j  | j i | d
 6| d 6| d	 6| d 6|	 d 6 q Wq= Wd S(   sA   Fill self.extensions with data from the default and user configs.t   active_onlyt   enablet   rawR  R  R  R   R  Rb  R\  R   RR  N(   Rf  R   t   GetExtensionsR  R8  R+  Rx  t
   startswitht   removeRy  R  t   KeyErrorR   R  R   R,  R|   R   Rr  R  (
   RE   R=  t   opt_listt   opt_namet   enablest   def_strt   def_objt   opt_typeR   RR  (    (    s%   lib/python2.7/idlelib/configDialog.pyR/    sH    	
	

	
c         C   s   |  j  j   } | r* |  j  j |  } n  | d  k sE | |  j k r |  j r |  j j d d  |  j |  j j   d  |  _ q n  | r |  j j d |  |  j | j	 d d d d d d  | |  _ n  d  S(   NR`   R
   R   i    R   R   R)  (
   R1  R  RV  R   R5  R3  R   R4  t   grid_forgetR  (   RE   R   t   newsel(    (    s%   lib/python2.7/idlelib/configDialog.pyR2  $  s    	#c         C   s~  t  |  j d d d d } | |  j | <| j } xFt |  j |  D]1\ } } t | d | d } | j d | d d d	 t  | d
 } | d d k r t	 | d | d | d d d d d t
 d d d d j d | d d d	 t d d  qE | d d k rHt | d | d d d |  j d f j d | d d d	 t d d  qE t | d | j d | d d d	 t d d  qE Wd S(    s=   Create a frame holding the widgets to configure one extensionR)   i   R*   R`   R\  R   R   i    R   RR  R  R  R  Rq   Rr   R  Rs   R  t   indicatoront   selectcolorR
   i   i   R[   i   R   t   validateR  t   validatecommands   %PN(   t   VerticalScrolledFrameR3  R4  t   interiort	   enumerateRf  R   R  t   NWR   R:   R   R  R.  R  (   RE   R=  t   ft
   entry_areaR   t   optt   labelRR  (    (    s%   lib/python2.7/idlelib/configDialog.pyR9  2  s&    	 
c         C   sv   | d } | d } | d j    j   p- | } | d j |  | | k r` |  j j | |  S|  j j | | |  S(   NR\  Rb  RR  (   RV  t   stripR   R,  R  R  (   RE   Rt  RW  R\  Rb  R   (    (    s%   lib/python2.7/idlelib/configDialog.pyt   set_extension_valueL  s    

c         C   sm   t  } xJ |  j D]? } |  j | } x) | D]! } |  j | |  r* t } q* q* Wq W| ri |  j j   n  d S(   s3   Save configuration changes to the user config file.N(   R  Rf  RZ  R  R,  R  (   RE   t   has_changesR=  R}  RW  (    (    s%   lib/python2.7/idlelib/configDialog.pyR  X  s    N(Q   t   __name__t
   __module__R  R-   R8   RY   RT   RU   RV   RW   RB   RS  R@  RA  RB  RC  RD  RE  RF  RG  RH  RI  RJ  RK  RL  RM  RN  RO  R7   RW  R  R   R   R   R  R   R   R  Rn  R   R   R   RZ  R  R   R  R   R   R   Rc  R   R  Ra  R   R  R#  R!  R%  R  R  R  R  R	  R  RA   R  R  R  R  R  R  R>   R]   R^   R_   RX   R/  R2  R9  RZ  R  (    (    (    s%   lib/python2.7/idlelib/configDialog.pyR	      s   5			D	o	M	s		
																							$									
																	!									
					5	-			sh  When you click either the Apply or Ok buttons, settings in this
dialog that are different from IDLE's default are saved in
a .idlerc directory in your home directory. Except as noted,
these changes apply to all versions of IDLE installed on this
machine. Some do not take affect until IDLE is restarted.
[Cancel] only cancels changes made since the last save.
s   
Highlighting:
The IDLE Dark color theme is new in October 2015.  It can only
be used with older IDLE releases if it is saved as a custom
theme, with a different name.
RI   c         C   s5   |  s
 t  Sy t |   t  SWn t k
 r0 t SXd S(   s(   Return 's is blank or represents an int'N(   R  R   R  R  (   R  (    (    s%   lib/python2.7/idlelib/configDialog.pyR.  v  s    
RQ  c           B   s   e  Z d  Z d   Z RS(   s   A pure Tkinter vertically scrollable frame.

    * Use the 'interior' attribute to place widgets inside the scrollable frame
    * Construct and pack/place/grid normally
    * This frame only allows vertical scrolling
    c      
      s0  t  j |  | | |  t |  d t } | j d t d t d t  t |  d d d d d | j	 d	 d
     j d t
 d t d t  | j d   j    j d    j d  t     |  _    j d d d  d t     f d   }  j d |      f d   }   j d |  d  S(   NRv   RO   RM   RN   R   i    R   Rp   R*   i   Ra   t   windowR{   c            s0    j     j   f }   j d d |  d  S(   Nt   scrollregions	   0 0 %s %s(   t   winfo_reqwidtht   winfo_reqheightR   (   R   R  (   t   canvasRR  (    s%   lib/python2.7/idlelib/configDialog.pyt   _configure_interior  s    s   <Configure>c            s8    j      j   k r4   j  d   j   n  d  S(   NR*   (   R`  t   winfo_widtht   itemconfigure(   R   (   Rb  RR  t   interior_id(    s%   lib/python2.7/idlelib/configDialog.pyt   _configure_canvas  s    (   Rd   R-   R   t   VERTICALRP   R   R   R:   t   CanvasR   Rf   RS   RR   R   R   t   xview_movetot   yview_movetoRR  t   create_windowRT  R   (   RE   R.   R  t   kwt
   vscrollbarRc  Rg  (    (   Rb  RR  Rf  s%   lib/python2.7/idlelib/configDialog.pyR-     s     (   R\  R]  t   __doc__R-   (    (    (    s%   lib/python2.7/idlelib/configDialog.pyRQ    s   t   __main__s#   idlelib.idle_test.test_configdialogt	   verbosityi   t   exit(   t   run("   Ro  t   TkinterR  R  R   t   idlelib.configHandlerR   t   idlelib.dynOptionMenuWidgetR   t   idlelib.keybindingDialogR   t   idlelib.configSectionNameDialogR   t   idlelib.configHelpSourceEditR   t   idlelib.tabbedpagesR   t   idlelib.textViewR   t   idlelibR   R,   R	   R!  R"  R.  Rd   RQ  R\  t   unittestRT  R  t   idlelib.idle_test.htestRs  (    (    (    s%   lib/python2.7/idlelib/configDialog.pyt   <module>   s6   
$     X
	+