Exemplo n.º 1
0
    def defaults(self):
        """Return the defaults, with their values interpolated (with the
        defaults dict itself)

        Mainly to support defaults using values such as %(here)s
        """
        defaults = ConfigParser.defaults(self).copy()
        for key, val in iteritems(defaults):
            defaults[key] = self.get('DEFAULT', key) or val
        return defaults
Exemplo n.º 2
0
    def defaults(self):
        """Return the defaults, with their values interpolated (with the
        defaults dict itself)

        Mainly to support defaults using values such as %(here)s
        """
        defaults = ConfigParser.defaults(self).copy()
        for key, val in iteritems(defaults):
            defaults[key] = self.get('DEFAULT', key) or val
        return defaults
Exemplo n.º 3
0
 def _interpolate(self, section, option, rawval, vars):
     # Python < 3.2
     try:
         return ConfigParser._interpolate(
             self, section, option, rawval, vars)
     except Exception:
         e = sys.exc_info()[1]
         args = list(e.args)
         args[0] = 'Error in file %s: %s' % (self.filename, e)
         e.args = tuple(args)
         e.message = args[0]
         raise
Exemplo n.º 4
0
 def _interpolate(self, section, option, rawval, vars):
     # Python < 3.2
     try:
         return ConfigParser._interpolate(
             self, section, option, rawval, vars)
     except Exception:
         e = sys.exc_info()[1]
         args = list(e.args)
         args[0] = 'Error in file %s: %s' % (self.filename, e)
         e.args = tuple(args)
         e.message = args[0]
         raise
Exemplo n.º 5
0
 def __init__(self, filename, *args, **kw):
     ConfigParser.__init__(self, *args, **kw)
     self.filename = filename
     if hasattr(self, '_interpolation'):
         self._interpolation = self.InterpolateWrapper(self._interpolation)
Exemplo n.º 6
0
 def __init__(self, filename, *args, **kw):
     ConfigParser.__init__(self, *args, **kw)
     self.filename = filename
     if hasattr(self, '_interpolation'):
         self._interpolation = self.InterpolateWrapper(self._interpolation)