From 458561fe6fcf334a2acd48b6344e6178a7eec18f Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 1 Dec 2016 11:37:06 -0500 Subject: [PATCH] In AdjustableSettings, initialize all keys on init Settings.update() method expects keys to already be present, so load them all up front --- lbrynet/conf.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 4ad0cda1a..bbcfd9306 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -185,6 +185,10 @@ class AdjustableSettings(Settings): """Settings that are allowed to be overriden by the user""" def __init__(self, environ=None): self.environ = environ or ENVIRONMENT + + for opt in self.environ.original_schema: + self.__dict__[opt] = self.environ(opt) + Settings.__init__(self) def __getattr__(self, attr): @@ -192,13 +196,6 @@ class AdjustableSettings(Settings): return self.environ(attr) raise AttributeError - def get_dict(self): - return { - name: self.environ(name) - for name in self.environ.original_schema - } - - class ApplicationSettings(Settings): """Settings that are constants and shouldn't be overriden""" def __init__(self):