From dca028c9cb936bf1a3f2de36b903bc2410144abf Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 2 Oct 2016 15:14:22 +0800 Subject: configs/manager.py: Refactor "get()" method and remove "set()" --- fg21sim/configs/manager.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'fg21sim/configs/manager.py') diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index 513878f..eabff00 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -91,14 +91,7 @@ class ConfigManager: def get(self, key, fallback=None): """Get config value by key.""" - if key in self._config: - value = self._config[key] - else: - value = fallback - return value - - def set(self, key, value): - self._config[key] = value + return self._config.get(key, fallback) @property def logging(self): -- cgit v1.2.2