Module configobj :: Class TemplateInterpolation
[hide private]
[frames] | no frames]

Class TemplateInterpolation

source code

         object --+    
                  |    
InterpolationEngine --+
                      |
                     TemplateInterpolation

Behaves like string.Template.

Instance Methods [hide private]
 
_parse_match(self, match)
Implementation-dependent helper function.
source code

Inherited from InterpolationEngine: __init__, interpolate

Inherited from InterpolationEngine (private): _fetch

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _cookie = '$'
  _delimiter = '$'
  _KEYCRE = re.compile(r'(?ix)\$(?:(?P<escaped>\$)|(?P<named>[_a...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_parse_match(self, match)

source code 

Implementation-dependent helper function.

Will be passed a match object corresponding to the interpolation key we just found (e.g., "%(foo)s" or "$foo"). Should look up that key in the appropriate config file section (using the ``_fetch()`` helper function) and return a 3-tuple: (key, value, section)

``key`` is the name of the key we're looking for ``value`` is the value found for that key ``section`` is a reference to the section where it was found

``key`` and ``section`` should be None if no further interpolation should be performed on the resulting value (e.g., if we interpolated "$$" and returned "$").

Overrides: InterpolationEngine._parse_match
(inherited documentation)

Class Variable Details [hide private]

_KEYCRE

Value:
re.compile(r'(?ix)\$(?:(?P<escaped>\$)|(?P<named>[_a-z][_a-z0-9]*)|\{(\
?P<braced>[^\}]*)\})')