Back to index

python3.2  3.2.2
Public Member Functions | Private Member Functions | Private Attributes
configparser.SectionProxy Class Reference
Inheritance diagram for configparser.SectionProxy:
Inheritance graph
[legend]
Collaboration diagram for configparser.SectionProxy:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __repr__
def __getitem__
def __setitem__
def __delitem__
def __contains__
def __len__
def __iter__
def get
def getint
def getfloat
def getboolean
def parser
def name

Private Member Functions

def _options

Private Attributes

 _parser
 _name

Detailed Description

A proxy for a single section from a parser.

Definition at line 1183 of file configparser.py.


Constructor & Destructor Documentation

def configparser.SectionProxy.__init__ (   self,
  parser,
  name 
)
Creates a view on a section of the specified `name` in `parser`.

Definition at line 1186 of file configparser.py.

01186 
01187     def __init__(self, parser, name):
01188         """Creates a view on a section of the specified `name` in `parser`."""
01189         self._parser = parser
01190         self._name = name

Here is the caller graph for this function:


Member Function Documentation

def configparser.SectionProxy.__contains__ (   self,
  key 
)

Definition at line 1208 of file configparser.py.

01208 
01209     def __contains__(self, key):
01210         return self._parser.has_option(self._name, key)

def configparser.SectionProxy.__delitem__ (   self,
  key 
)

Definition at line 1203 of file configparser.py.

01203 
01204     def __delitem__(self, key):
01205         if not (self._parser.has_option(self._name, key) and
01206                 self._parser.remove_option(self._name, key)):
01207             raise KeyError(key)

def configparser.SectionProxy.__getitem__ (   self,
  key 
)

Definition at line 1194 of file configparser.py.

01194 
01195     def __getitem__(self, key):
01196         if not self._parser.has_option(self._name, key):
01197             raise KeyError(key)
01198         return self._parser.get(self._name, key)

Here is the caller graph for this function:

Definition at line 1214 of file configparser.py.

01214 
01215     def __iter__(self):
01216         return self._options().__iter__()

Here is the call graph for this function:

Definition at line 1211 of file configparser.py.

01211 
01212     def __len__(self):
01213         return len(self._options())

Here is the call graph for this function:

Definition at line 1191 of file configparser.py.

01191 
01192     def __repr__(self):
01193         return '<Section: {}>'.format(self._name)

def configparser.SectionProxy.__setitem__ (   self,
  key,
  value 
)

Definition at line 1199 of file configparser.py.

01199 
01200     def __setitem__(self, key, value):
01201         self._parser._validate_value_types(option=key, value=value)
01202         return self._parser.set(self._name, key, value)

def configparser.SectionProxy._options (   self) [private]

Definition at line 1217 of file configparser.py.

01217 
01218     def _options(self):
01219         if self._name != self._parser.default_section:
01220             return self._parser.options(self._name)
01221         else:
01222             return self._parser.defaults()

def configparser.SectionProxy.get (   self,
  option,
  fallback = None,
  raw = False,
  vars = None 
)

Definition at line 1223 of file configparser.py.

01223 
01224     def get(self, option, fallback=None, *, raw=False, vars=None):
01225         return self._parser.get(self._name, option, raw=raw, vars=vars,
01226                                 fallback=fallback)

Here is the caller graph for this function:

def configparser.SectionProxy.getboolean (   self,
  option,
  fallback = None,
  raw = False,
  vars = None 
)

Definition at line 1235 of file configparser.py.

01235 
01236     def getboolean(self, option, fallback=None, *, raw=False, vars=None):
01237         return self._parser.getboolean(self._name, option, raw=raw, vars=vars,
01238                                        fallback=fallback)

def configparser.SectionProxy.getfloat (   self,
  option,
  fallback = None,
  raw = False,
  vars = None 
)

Definition at line 1231 of file configparser.py.

01231 
01232     def getfloat(self, option, fallback=None, *, raw=False, vars=None):
01233         return self._parser.getfloat(self._name, option, raw=raw, vars=vars,
01234                                      fallback=fallback)

def configparser.SectionProxy.getint (   self,
  option,
  fallback = None,
  raw = False,
  vars = None 
)

Definition at line 1227 of file configparser.py.

01227 
01228     def getint(self, option, fallback=None, *, raw=False, vars=None):
01229         return self._parser.getint(self._name, option, raw=raw, vars=vars,
01230                                    fallback=fallback)

Definition at line 1245 of file configparser.py.

01245 
01246     def name(self):
01247         # The name of the section on a proxy is read-only.
01248         return self._name

Here is the caller graph for this function:

Definition at line 1240 of file configparser.py.

01240 
01241     def parser(self):
01242         # The parser object of the proxy is read-only.
01243         return self._parser


Member Data Documentation

Definition at line 1189 of file configparser.py.

Definition at line 1188 of file configparser.py.


The documentation for this class was generated from the following file: