From 82a05415f70e8000a069842df0d5d49abefe5484 Mon Sep 17 00:00:00 2001 From: Markus Date: Sat, 4 Jul 2020 22:05:01 +0200 Subject: [PATCH] simplify --- src/lib/terkin/configuration.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/lib/terkin/configuration.py b/src/lib/terkin/configuration.py index 5f39e44..93769ba 100644 --- a/src/lib/terkin/configuration.py +++ b/src/lib/terkin/configuration.py @@ -118,24 +118,16 @@ def add(self, data): """ self.record = False try: - self.add_real(data) + if isinstance(data, types.ModuleType): + blacklist = ['__name__', '__file__', '__class__'] + for key in dir(data): + if key in blacklist: continue + value = getattr(data, key) + self.store[key] = value except Exception as ex: log.exc(ex, 'Reading configuration settings failed') self.record = True - def add_real(self, data): - """ - - :param data: - - """ - if isinstance(data, types.ModuleType): - blacklist = ['__name__', '__file__', '__class__'] - for key in dir(data): - if key in blacklist: continue - value = getattr(data, key) - self.store[key] = value - def dump(self): """ """ log.info('Configuration settings:')