summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpjenvey <pjenvey@localhost>2008-06-01 23:37:51 +0000
committerpjenvey <pjenvey@localhost>2008-06-01 23:37:51 +0000
commitf4efc44c85935430f5e75aa7498c7cfe3069af43 (patch)
treef5485e5b6483d25329252c4941bd2482909e0eca
parent5887c196ccb777ba8ac4c5301631e4d2443a3268 (diff)
downloadpastedeploy-git-f4efc44c85935430f5e75aa7498c7cfe3069af43.tar.gz
stray from normal ConfigParser behavior and interpolate defaults (with
themselves). mainly to support using %(here)s
-rw-r--r--paste/deploy/loadwsgi.py11
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(