Back to index

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

List of all members.

Public Member Functions

def before_get
def before_set
def before_read
def before_write

Static Private Member Functions

def _interpolation_replace

Static Private Attributes

tuple _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")

Detailed Description

Deprecated interpolation used in old versions of ConfigParser.
Use BasicInterpolation or ExtendedInterpolation instead.

Definition at line 516 of file configparser.py.


Member Function Documentation

def configparser.LegacyInterpolation._interpolation_replace (   match,
  parser 
) [static, private]

Definition at line 546 of file configparser.py.

00546 
00547     def _interpolation_replace(match, parser):
00548         s = match.group(1)
00549         if s is None:
00550             return match.group()
00551         else:
00552             return "%%(%s)s" % parser.optionxform(s)
00553 

Here is the caller graph for this function:

def configparser.LegacyInterpolation.before_get (   self,
  parser,
  section,
  option,
  value,
  vars 
)

Reimplemented from configparser.Interpolation.

Definition at line 522 of file configparser.py.

00522 
00523     def before_get(self, parser, section, option, value, vars):
00524         rawval = value
00525         depth = MAX_INTERPOLATION_DEPTH
00526         while depth:                    # Loop through this until it's done
00527             depth -= 1
00528             if value and "%(" in value:
00529                 replace = functools.partial(self._interpolation_replace,
00530                                             parser=parser)
00531                 value = self._KEYCRE.sub(replace, value)
00532                 try:
00533                     value = value % vars
00534                 except KeyError as e:
00535                     raise InterpolationMissingOptionError(
00536                         option, section, rawval, e.args[0])
00537             else:
00538                 break
00539         if value and "%(" in value:
00540             raise InterpolationDepthError(option, section, rawval)
00541         return value

Here is the call graph for this function:

def configparser.Interpolation.before_read (   self,
  parser,
  section,
  option,
  value 
) [inherited]

Definition at line 365 of file configparser.py.

00365 
00366     def before_read(self, parser, section, option, value):
00367         return value

def configparser.LegacyInterpolation.before_set (   self,
  parser,
  section,
  option,
  value 
)

Reimplemented from configparser.Interpolation.

Definition at line 542 of file configparser.py.

00542 
00543     def before_set(self, parser, section, option, value):
00544         return value

def configparser.Interpolation.before_write (   self,
  parser,
  section,
  option,
  value 
) [inherited]

Definition at line 368 of file configparser.py.

00368 
00369     def before_write(self, parser, section, option, value):
00370         return value
00371 


Member Data Documentation

tuple configparser.LegacyInterpolation._KEYCRE = re.compile(r"%\(([^)]*)\)s|.") [static, private]

Definition at line 520 of file configparser.py.


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