
|Nc           @   sD  d  Z  d d l Z d d l Z d d l Z d d l m Z d d l m Z m Z m Z d e	 f d     YZ
 d e	 f d     YZ d	 e	 f d
     YZ d e	 f d     YZ d e f d     YZ d e f d     YZ d f  d     YZ e   Z e d k r@d   Z e e j  e e j  e j d j d d  GHn  d S(   s  Provides access to stored IDLE configuration information.

Refer to the comments at the beginning of config-main.def for a description of
the available configuration files and the design implemented to update user
configuration information.  In particular, user configuration choices which
duplicate the defaults will be removed from the user's configuration files,
and if a file becomes empty, it will be deleted.

The contents of the user files may be altered using the Options/Configure IDLE
menu to access the configuration GUI (configDialog.py), or manually.

Throughout this module there is an emphasis on returning useable defaults
when a problem occurs in returning a requested configuration value back to
idle. This is to allow IDLE to continue to function in spite of errors in
the retrieval of config information. When a default is returned instead of
a requested config value, a message is printed to stderr to aid in
configuration problem notification and resolution.

iN(   t   macosxSupport(   t   ConfigParsert   NoOptionErrort   NoSectionErrort   InvalidConfigTypec           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR      s    t   InvalidConfigSetc           B   s   e  Z RS(    (   R   R   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR      s    t   InvalidFgBgc           B   s   e  Z RS(    (   R   R   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR      s    t   InvalidThemec           B   s   e  Z RS(    (   R   R   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR	      s    t   IdleConfParserc           B   s>   e  Z d  Z d d  Z d d e d  Z d   Z d   Z RS(   sI   
    A ConfigParser specialised for idle configuration file handling
    c         C   s    | |  _  t j |  d | d S(   sK   
        cfgFile - string, fully specified configuration file name
        t   defaultsN(   t   fileR   t   __init__(   t   selft   cfgFilet   cfgDefaults(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR   #   s    	c         C   sh   |  j  | |  s | S| d k r2 |  j | |  S| d k rN |  j | |  S|  j | | d | Sd S(   s   
        Get an option value for given section/option or return default.
        If type is specified, return as type.
        t   boolt   intt   rawN(   t
   has_optiont
   getbooleant   getintt   get(   R   t   sectiont   optiont   typet   defaultR   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   Get*   s    c         C   s$   |  j  |  r |  j |  Sg  Sd S(   s6   
        Get an option list for given section
        N(   t   has_sectiont   options(   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetOptionList8   s    c         C   s   |  j  |  j  d S(   s7   
        Load the configuration file from disk
        N(   t   readR   (   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   LoadA   s    N(	   R   R   t   __doc__t   NoneR   t   FalseR   R   R!   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR
      s
   		t   IdleUserConfParserc           B   sM   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   sG   
    IdleConfigParser specialised for user configuration handling.
    c         C   s#   |  j  |  s |  j |  n  d S(   s2   
        if section doesn't exist, add it
        N(   R   t   add_section(   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt
   AddSectionL   s    c         C   s:   x3 |  j    D]% } |  j |  s |  j |  q q Wd S(   s:   
        remove any sections that have no options
        N(   t   sectionsR   t   remove_section(   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   RemoveEmptySectionsS   s    c         C   s"   |  j    |  j   r d Sd Sd S(   sp   
        Remove empty sections and then return 1 if parser has no sections
        left, else return 0.
        i    i   N(   R*   R(   (   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   IsEmpty[   s    
c         C   s#   |  j  |  r |  j | |  Sd S(   sl   
        If section/option exists, remove it.
        Returns 1 if option was removed, 0 otherwise.
        N(   R   t   remove_option(   R   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   RemoveOptionf   s    c         C   s   |  j  | |  rH |  j | |  | k r. d S|  j | | |  d Sn6 |  j |  sg |  j |  n  |  j | | |  d Sd S(   s   
        Sets option to value, adding section if required.
        Returns 1 if option was added or changed, otherwise 0.
        i    i   N(   R   R   t   setR   R&   (   R   R   R   t   value(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt	   SetOptionn   s    c         C   s,   t  j j |  j  r( t  j |  j  n  d S(   sF   
        Removes the user config file from disk if it exists.
        N(   t   ost   patht   existsR   t   remove(   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt
   RemoveFile   s    c         C   sv   |  j    sh |  j } y t | d  } Wn- t k
 rW t j |  t | d  } n X|  j |  n
 |  j   d S(   s   Update user configuration file.

        Remove empty sections. If resulting config isn't empty, write the file
        to disk. If config is empty, remove the file from disk if it exists.

        t   wN(   R+   R   t   opent   IOErrorR1   t   unlinkt   writeR5   (   R   t   fnameR   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   Save   s    	(
   R   R   R"   R'   R*   R+   R-   R0   R5   R<   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR%   G   s   						t   IdleConfc           B   s
  e  Z d  Z d   Z d   Z d   Z d d e e d  Z	 d   Z
 d   Z d d  Z d   Z d	   Z d
   Z e e e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z d   Z RS(   s  
    holds config parsers for all idle config files:
    default config files
        (idle install dir)/config-main.def
        (idle install dir)/config-extensions.def
        (idle install dir)/config-highlight.def
        (idle install dir)/config-keys.def
    user config  files
        (user home dir)/.idlerc/config-main.cfg
        (user home dir)/.idlerc/config-extensions.cfg
        (user home dir)/.idlerc/config-highlight.cfg
        (user home dir)/.idlerc/config-keys.cfg
    c         C   s3   i  |  _  i  |  _ i  |  _ |  j   |  j   d  S(   N(   t
   defaultCfgt   userCfgt   cfgt   CreateConfigHandlerst   LoadCfgFiles(   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR      s
    			
c         C   s   t  d k r! t j j t  } n t j j t j d  } |  j   } d } i  } i  } xP | D]H } t j j | d | d  | | <t j j | d | d	  | | <q_ Wx< | D]4 } t	 | |  |  j
 | <t | |  |  j | <q Wd
 S(   sp   
        set up a dictionary of config parsers for default and user
        configurations respectively
        t   __main__i    t   maint
   extensionst	   highlightt   keyss   config-s   .defs   .cfgN(   s   mains
   extensionss	   highlights   keys(   R   R1   R2   t   dirnamet   __file__t   abspatht   syst   GetUserCfgDirt   joinR
   R>   R%   R?   (   R   t   idleDirt   userDirt   configTypest   defCfgFilest   usrCfgFilest   cfgType(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyRA      s    !%c         C   s  d } t  j j d  } | d k rx t  j j |  sx d | d } y t j j |  Wn t k
 rk n Xd } qx n  | d k r t  j   } n  t  j j	 | |  } t  j j |  sy t  j
 |  Wqt t f k
 rd | d } t j j |  t  qXn  | S(   sr   
        Creates (if required) and returns a filesystem directory for storing
        user config files.

        s   .idlerct   ~s.   
 Warning: os.path.expanduser("~") points to
 s    ,
 but the path does not exist.
s2   
 Warning: unable to create user config directory
s)   
 Check path and permissions.
 Exiting!

(   R1   R2   t
   expanduserR3   RK   t   stderrR:   R8   t   getcwdRM   t   mkdirt   OSErrort
   SystemExit(   R   t   cfgDirRO   t   warn(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyRL      s*    c   	      C   s   |  j  | j | |  r< |  j  | j | | d | d | S|  j | j | |  rx |  j | j | | d | d | S| r d | | | f } y t j j |  Wq t k
 r q Xn  | Sd S(   sf  
        Get an option value for given config type and given general
        configuration section/option or return a default. If type is specified,
        return as type. Firstly the user configuration is checked, with a
        fallback to the default configuration, and a final 'catch all'
        fallback to a useable passed-in default if the option isn't present in
        either the user or the default configuration.
        configType must be one of ('main','extensions','highlight','keys')
        If a default is returned, and warn_on_default is True, a warning is
        printed to stderr.

        R   R   s   
 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option %r
 from section %r.
 returning default value: %r
N(   R?   R   R   R>   RK   RV   R:   R8   (	   R   t
   configTypeR   R   R   R   t   warn_on_defaultR   t   warning(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt	   GetOption   s    c         C   s   |  j  | j | | |  d S(   s?   In user's config file, set section's option to value.

        N(   R?   R0   (   R   R]   R   R   R/   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR0     s    c         C   sc   | d	 k r t  d  n  | d k r4 |  j | } n% | d k rP |  j | } n	 t d  | j   S(
   s   
        Get a list of sections from either the user or default config for
        the given config type.
        configSet must be either 'user' or 'default'
        configType must be one of ('main','extensions','highlight','keys')
        RD   RE   RF   RG   s   Invalid configType specifiedt   userR   s   Invalid configSet specified(   s   mains
   extensionss	   highlights   keys(   R   R?   R>   R   R(   (   R   t	   configSetR]   t	   cfgParser(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetSectionList	  s    	c         C   s   |  j  d j |  r+ |  j d |  } n |  j d |  } | | d } | d k rd | d } n | | d } i | d 6| d	 6} | s | S| d
 k r | d S| d k r | d	 St d  d S(   s$  
        return individual highlighting theme elements.
        fgBg - string ('fg'or'bg') or None, if None return a dictionary
        containing fg and bg colours (appropriate for passing to Tkinter in,
        e.g., a tag_config call), otherwise fg or bg colour only as specified.
        RF   R   Ra   s   -foregroundt   cursors   normal-backgrounds   -backgroundt
   foregroundt
   backgroundt   fgt   bgs   Invalid fgBg specifiedN(   R>   R   t   GetThemeDictR   (   R   t   themet   elementt   fgBgt	   themeDictt   foret   backRF   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetHighlight  s    c         C   s  | d k r |  j  d } n% | d k r8 |  j d } n	 t d  i d d 6d d 6d d	 6d d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d d! 6d d" 6} x | j   D] } | j | |  skd# | | | | f } y t j j |  Wqkt k
 rgqkXn  | j	 | | d | | } | | | <qW| S($   sj  
        type - string, 'default' or 'user' theme type
        themeName - string, theme name
        Returns a dictionary which holds {option:value} for each element
        in the specified theme. Values are loaded over a set of ultimate last
        fallback defaults to guarantee that all theme elements are present in
        a newly created theme.
        Ra   RF   R   s   Invalid theme type specifieds   #000000s   normal-foregrounds   #ffffffs   normal-backgrounds   keyword-foregrounds   keyword-backgrounds   builtin-foregrounds   builtin-backgrounds   comment-foregrounds   comment-backgrounds   string-foregrounds   string-backgrounds   definition-foregrounds   definition-backgrounds   hilite-foregroundt   grays   hilite-backgrounds   break-foregrounds   break-backgrounds   hit-foregrounds   hit-backgrounds   error-foregrounds   error-backgrounds   cursor-foregrounds   stdout-foregrounds   stdout-backgrounds   stderr-foregrounds   stderr-backgrounds   console-foregrounds   console-backgrounds   
 Warning: configHandler.py - IdleConf.GetThemeDict -
 problem retrieving theme element %r
 from theme %r.
 returning default value: %r
(
   R?   R>   R	   RG   R   RK   RV   R:   R8   R   (   R   R   t	   themeNameRc   Rk   Rl   R_   t   colour(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyRj   5  sV    		

c         C   s   |  j  d d d d d S(   s@   
        Returns the name of the currently active theme
        RD   t   Themet   nameR   t    (   R`   (   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   CurrentThemeu  s    c         C   s   |  j  d d d d d S(   sB   
        Returns the name of the currently active key set
        RD   t   KeysRv   R   Rw   (   R`   (   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   CurrentKeys{  s    c   	      C   s  |  j  |  j d d   } |  j  |  j d d   } x* | D]" } | | k r= | j |  q= q= W| rg  } x | D] } |  j d | d d t d d rv | s | r | r d } n d } |  j d | | d t d d d	 t r| j |  qq| j |  qv qv W| S| Sd
 S(   s   
        Gets a list of all idle extensions declared in the config files.
        active_only - boolean, if true only return active (enabled) extensions
        R   RE   Ra   t   enableR   R   t   enable_editort   enable_shellR^   N(   t   RemoveKeyBindNamesRd   t   appendR`   t   TrueR$   (	   R   t   active_onlyt   editor_onlyt
   shell_onlyt   extnst	   userExtnst   extnt   activeExtnsR   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetExtensions  s.    			c         C   su   | } g  } x6 | D]. } | j  d  r | j | j |   q q W| j   | j   x | D] } | | =q` W| S(   Nt	   _bindingst   _cfgBindings(   R   R   (   t   endswithR   t   indext   sortt   reverse(   R   t   extnNameListt   namest   kbNameIndiciesRv   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR~     s    

c         C   sj   d } d | d } xO |  j d d  D]; } x2 |  j |  j   D] } | | k rC | } qC qC Wq' W| S(   s   
        Returns the name of the extension that virtualEvent is bound in, or
        None if not bound in any extension.
        virtualEvent - string, name of the virtual event to test for, without
                       the enclosing '<< >>'
        s   <<s   >>R   i    N(   R#   R   t   GetExtensionKeysRG   (   R   t   virtualEventt   extNamet   vEventR   t   event(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetExtnNameForEvent  s    c   	      C   s   | d } |  j    } i  } |  j d j |  r~ |  j d j |  } x3 | D]( } d | d } | | } | | | <qO Wn  | S(   s   
        returns a dictionary of the configurable keybindings for a particular
        extension,as they exist in the dictionary returned by GetCurrentKeySet;
        that is, where previously used bindings are disabled.
        R   RE   s   <<s   >>(   t   GetCurrentKeySetR>   R   R   (	   R   t   extensionNamet   keysNamet
   activeKeyst   extKeyst
   eventNamest	   eventNameR   t   binding(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR     s    

c         C   s   | d } i  } |  j  d j |  r |  j  d j |  } xJ | D]? } |  j d | | d d j   } d | d } | | | <qC Wn  | S(   s   
        returns a dictionary of the configurable keybindings for a particular
        extension, as defined in the configuration files, or an empty dictionary
        if no bindings are found
        R   RE   R   Rw   s   <<s   >>(   R>   R   R   R`   t   split(   R   R   R   R   R   R   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   __GetRawExtensionKeys  s    
c         C   s   | d } |  j  |  } |  j d j |  r |  j d j |  } xJ | D]? } |  j d | | d d j   } d | d } | | | <qL Wn  | S(   s  
        Returns a dictionary of all the event bindings for a particular
        extension. The configurable keybindings are returned as they exist in
        the dictionary returned by GetCurrentKeySet; that is, where re-used
        keybindings are disabled.
        R   RE   R   Rw   s   <<s   >>(   R   R>   R   R   R`   R   (   R   R   t	   bindsNamet   extBindsR   R   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetExtensionBindings  s    
c         C   s2   | d d !} |  j  d | | d d j   } | S(   s   
        returns the keybinding for a specific event.
        keySetName - string, name of key binding set
        eventStr - string, the virtual event we want the binding for,
                   represented as a string, eg. '<<event>>'
        i   iRG   R   Rw   (   R`   R   (   R   t
   keySetNamet   eventStrR   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetKeyBinding  s    !c         C   s   |  j  |  j    } t j   r x[ | j   D]J \ } } g  | D] } | j d d  ^ qA } | | k r. | | | <q. q. Wn  | S(   Ns   <Alt-s   <Option-(   t	   GetKeySetRz   R    t   runningAsOSXAppt   itemst   replace(   R   t   resultt   kt   vt   xt   v2(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR     s    %c         C   s   |  j  |  } |  j d d  } xn | D]f } |  j |  } | r( xH | j   D]7 } | | | j   k ry d | | <n  | | | | <qP Wq( q( W| S(   s   
        Returns a dictionary of: all requested core keybindings, plus the
        keybindings for all currently active extensions. If a binding defined
        in an extension is already in use, that binding is disabled.
        R   i   Rw   (   t   GetCoreKeysR   t   _IdleConf__GetRawExtensionKeysRG   t   values(   R   R   t   keySetR   R   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR     s    c         C   s   d | d |  j    j   k S(   s   
        returns true if the virtual event is bound in the core idle keybindings.
        virtualEvent - string, name of the virtual event to test for, without
                       the enclosing '<< >>'
        s   <<s   >>(   R   RG   (   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   IsCoreBinding  s    c         C   s  i1 d d g d 6d d g d 6d d g d	 6d
 d g d 6d g d 6d g d 6d g d 6d g d 6d g d 6d g d 6d g d 6d g d 6d g d 6d g d 6d g d  6d! g d" 6d# g d$ 6d% g d& 6d' g d( 6d) g d* 6d+ g d, 6d- g d. 6d/ g d0 6d1 g d2 6d3 g d4 6d5 g d6 6d7 g d8 6d9 g d: 6d; g d< 6d= g d> 6d? d@ g dA 6dB g dC 6dD g dE 6dF g dG 6dH g dI 6dJ g dK 6dL g dM 6dN g dO 6dP g dQ 6dR g dS 6dT g dU 6dV g dW 6dX g dY 6dZ g d[ 6d\ g d] 6d^ g d_ 6d` g da 6db g dc 6dd g de 6} | rx{ | j    D]j } |  j | |  } | r=| | | <qdf | | | | f } y t j j |  Wqt k
 r{qXqWn  | S(g   sZ  
        returns the requested set of core keybindings, with fallbacks if
        required.
        Keybindings loaded from the config file(s) are loaded _over_ these
        defaults, so if there is a problem getting any core binding there will
        be an 'ultimate last resort fallback' to the CUA-ish bindings
        defined here.
        s   <Control-c>s   <Control-C>s   <<copy>>s   <Control-x>s   <Control-X>s   <<cut>>s   <Control-v>s   <Control-V>s	   <<paste>>s   <Control-a>s   <Home>s   <<beginning-of-line>>s   <Control-l>s   <<center-insert>>s   <Control-q>s   <<close-all-windows>>s   <Alt-F4>s   <<close-window>>s   <<do-nothing>>s   <Control-d>s   <<end-of-file>>s   <F1>s   <<python-docs>>s
   <Shift-F1>s   <<python-context-help>>s   <Alt-n>s   <<history-next>>s   <Alt-p>s   <<history-previous>>s   <<interrupt-execution>>s   <F6>s   <<view-restart>>s   <Control-F6>s   <<restart-shell>>s   <Alt-c>s   <<open-class-browser>>s   <Alt-m>s   <<open-module>>s   <Control-n>s   <<open-new-window>>s   <Control-o>s   <<open-window-from-file>>s   <Control-j>s   <<plain-newline-and-indent>>s   <Control-p>s   <<print-window>>s   <Control-y>s   <<redo>>s   <Escape>s   <<remove-selection>>s   <Alt-Shift-S>s   <<save-copy-of-window-as-file>>s   <Alt-s>s   <<save-window-as-file>>s   <Control-s>s   <<save-window>>s   <Alt-a>s   <<select-all>>s   <Control-slash>s   <<toggle-auto-coloring>>s   <Control-z>s   <<undo>>s   <Control-g>s   <F3>s   <<find-again>>s   <Alt-F3>s   <<find-in-files>>s   <Control-F3>s   <<find-selection>>s   <Control-f>s   <<find>>s   <Control-h>s   <<replace>>s   <Alt-g>s   <<goto-line>>s   <Key-BackSpace>s   <<smart-backspace>>s   <Key-Return> <Key-KP_Enter>s   <<newline-and-indent>>s	   <Key-Tab>s   <<smart-indent>>s   <Control-Key-bracketright>s   <<indent-region>>s   <Control-Key-bracketleft>s   <<dedent-region>>s   <Alt-Key-3>s   <<comment-region>>s   <Alt-Key-4>s   <<uncomment-region>>s   <Alt-Key-5>s   <<tabify-region>>s   <Alt-Key-6>s   <<untabify-region>>s   <Alt-Key-t>s   <<toggle-tabs>>s   <Alt-Key-u>s   <<change-indentwidth>>s   <Control-Key-BackSpace>s   <<del-word-left>>s   <Control-Key-Delete>s   <<del-word-right>>s   
 Warning: configHandler.py - IdleConf.GetCoreKeys -
 problem retrieving key binding for event %r
 from key set %r.
 returning default value: %r
(   RG   R   RK   RV   R:   R8   (   R   R   t   keyBindingsR   R   R_   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR   '  s|    	










































c   	      C   s  g  } | d k r" |  j  d } n% | d k r> |  j d } n	 t d  | j d  } x | D] } | j d | d d } | j d  d k r d } d } n2 t j | d  } | d	 j   } | d
 j   } | r] | r] | j	 | | | f  q] q] W| j
 d d    | S(   s  Fetch list of extra help sources from a given configSet.

        Valid configSets are 'user' or 'default'.  Return a list of tuples of
        the form (menu_item , path_to_help_file , option), or return the empty
        list.  'option' is the sequence number of the help resource.  'option'
        values determine the position of the menu items on the Help menu,
        therefore the returned list must be sorted by 'option'.

        Ra   RD   R   s   Invalid configSet specifiedt	   HelpFilest   ;iRw   i    i   t   keyc         S   s   t  |  d  S(   Ni   (   R   (   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   <lambda>  s    (   R?   R>   R   R   R   t   findt   stringR   t   stripR   R   (	   R   Rb   t   helpSourcesRc   R   R   R/   t   menuItemt   helpPath(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetExtraHelpSourceListt  s&    
		c         C   s    |  j  d  |  j  d  } | S(   s   
        Returns a list of tuples containing the details of all additional help
        sources configured, or an empty list if there are none. Tuples are of
        the format returned by GetExtraHelpSourceList.
        R   Ra   (   R   (   R   t   allHelpSources(    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   GetAllExtraHelpSourcesList  s    c         C   s@   x9 |  j  j   D]( } |  j  | j   |  j | j   q Wd S(   s/   
        load all configuration files.
        N(   R>   RG   R!   R?   (   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyRB     s    c         C   s/   x( |  j  j   D] } |  j  | j   q Wd S(   sH   
        write all loaded user configuration files back to disk
        N(   R?   RG   R<   (   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   SaveUserCfgFiles  s    N(   R   R   R"   R   RA   RL   R#   R   R$   R`   R0   Rd   Rq   Rj   Rx   Rz   R   R~   R   R   R   R   R   R   R   R   R   R   R   RB   R   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyR=      s6   			 			@		!									M	 	
	RC   c         C   s   d G|  Gd GHx |  j    D]| } |  | j   } | GH| GHxY | D]Q } |  | j |  } | GH| GHx+ | D]# } | Gd G|  | j | |  GHqk WqA Wq Wd  S(   Ns   
t   =(   RG   R(   R   R   (   R@   R   R(   R   R   R   (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   dumpCfg  s    RD   Ru   Rv   (   R"   R1   RK   R   t   idlelibR    R   R   R   t	   ExceptionR   R   R   R	   R
   R%   R=   t   idleConfR   R   R>   R?   R   (    (    (    s*   C:\RCS\Python\lib\idlelib\configHandler.pyt   <module>   s(   (Q  		