move default config expansion to function body (default already exists)

This commit is contained in:
Martin Zimmermann 2016-01-09 00:31:45 +01:00
parent 93e783ed60
commit 622b59f8a4

View File

@ -22,14 +22,12 @@ class Dispatcher(DispatcherMiddleware):
a relative URI, e.g. /foo.example and /other.bar. a relative URI, e.g. /foo.example and /other.bar.
""" """
default = os.path.join(dist.location, dist.project_name, "defaults.ini")
def __init__(self, *confs): def __init__(self, *confs):
self.isso = {} self.isso = {}
default = os.path.join(dist.location, dist.project_name, "defaults.ini")
for i, path in enumerate(confs): for i, path in enumerate(confs):
conf = config.load(Dispatcher.default, path) conf = config.load(default, path)
if not conf.get("general", "name"): if not conf.get("general", "name"):
logger.warn("unable to dispatch %r, no 'name' set", confs[i]) logger.warn("unable to dispatch %r, no 'name' set", confs[i])