# eric6.Globals.E5ConfigParser

Module implementing a ConfigParser wrapper for Python 2 to provide the dictionary like interface of the Python 3 variant.

### Global Attributes

None

### Classes

E5ConfigParser | Class implementing a wrapper of the ConfigParser class implementing dictionary like special methods and some enhancements from Python 3.

### Functions

None

## E5ConfigParser

Class implementing a wrapper of the ConfigParser class implementing dictionary like special methods and some enhancements from Python 3.

### Derived from

SafeConfigParser

### Class Attributes

OPTCRE
OPTCRE_NV
_OPT_NV_TMPL
_OPT_TMPL

### Class Methods

None

### Methods

E5ConfigParser | Constructor
__contains__ | Special method to test, if a section is contained in the config.
__delitem__ | Special method to delete a section.
__getitem__ | Special method to get a section.
__iter__ | Special method to return an iterator of the section names starting with the default section.
__len__ | Special method get the number of sections of the config.
__setitem__ | Special method to set the values of a section.

### Static Methods

None

#### E5ConfigParser (Constructor)

E5ConfigParser(defaults=None, dict_type=_default_dict, allow_no_value=False, delimiters=('=', ':'))

Constructor

#### E5ConfigParser.__contains__

__contains__(key)

Special method to test, if a section is contained in the config.

key (str)
  name of the section

Returns:
  flag indicating containment

Return Type:
  bool

#### E5ConfigParser.__delitem__

__delitem__(key)

Special method to delete a section.

key (str)
  name of the section

Raises KeyError:
  raised to indicate a non-existent section
Raises ValueError:
  raised to indicate non-removal of the default section

#### E5ConfigParser.__getitem__

__getitem__(key)

Special method to get a section.

key (str)
  name of the section

Returns:
  section for the given key

Return Type:
  dict

Raises KeyError:
  raised if a non-existent key is given

#### E5ConfigParser.__iter__

__iter__()

Special method to return an iterator of the section names starting with the default section.

Returns:
  iterator of the section names contained in the config

Return Type:
  iterator of str

#### E5ConfigParser.__len__

__len__()

Special method get the number of sections of the config.

Returns:
  number of sections

Return Type:
  int

#### E5ConfigParser.__setitem__

__setitem__(key, values)

Special method to set the values of a section.

key (str)
  name of the section
values (dict)
  value for the section

Up