//usr/lib64/lib64//lib64/lib64//
ۜSec @ 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- /usr/lib64/python2.7/idlelib/configHandler.pyR s t InvalidConfigSetc B s e Z RS( ( R R ( ( ( s- /usr/lib64/python2.7/idlelib/configHandler.pyR s t InvalidFgBgc B s e Z RS( ( R R ( ( ( s- /usr/lib64/python2.7/idlelib/configHandler.pyR s t InvalidThemec B s e Z RS( ( R R ( ( ( s- /usr/lib64/python2.7/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- /usr/lib64/python2.7/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- /usr/lib64/python2.7/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- /usr/lib64/python2.7/idlelib/configHandler.pyt
GetOptionList8 s
c C s | j | j d S( s7
Load the configuration file from disk
N( t readR ( R ( ( s- /usr/lib64/python2.7/idlelib/configHandler.pyt LoadA s N( R R t __doc__t NoneR
t FalseR R R! ( ( ( s- /usr/lib64/python2.7/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- /usr/lib64/python2.7/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- /usr/lib64/python2.7/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- /usr/lib64/python2.7/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- /usr/lib64/python2.7/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&