diff options
author | pjenvey <devnull@localhost> | 2008-06-01 23:37:51 +0000 |
---|---|---|
committer | pjenvey <devnull@localhost> | 2008-06-01 23:37:51 +0000 |
commit | 2743a96941bddb0549fd2dfcf68c6abee193e9fb (patch) | |
tree | f5485e5b6483d25329252c4941bd2482909e0eca | |
parent | f77c349b32d3a2e75aa157cf10f966da9b1d0ee1 (diff) | |
download | pastedeploy-2743a96941bddb0549fd2dfcf68c6abee193e9fb.tar.gz |
stray from normal ConfigParser behavior and interpolate defaults (with
themselves). mainly to support using %(here)s
-rw-r--r-- | paste/deploy/loadwsgi.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index bd2ff75..bffa500 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -46,6 +46,17 @@ class NicerConfigParser(ConfigParser): ConfigParser.__init__(self, *args, **kw) self.filename = filename + 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 defaults.iteritems(): + defaults[key] = self._interpolate('DEFAULT', key, val, defaults) + return defaults + def _interpolate(self, section, option, rawval, vars): try: return ConfigParser._interpolate( |