From 8748f77a2dc32ceb47bbb1618c58d6cadb7a5bd1 Mon Sep 17 00:00:00 2001 From: Nick80835 Date: Fri, 17 Apr 2020 11:18:23 -0400 Subject: [PATCH] add optional default returns for settings --- ubot/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ubot/settings.py b/ubot/settings.py index 7671072..a23ea81 100644 --- a/ubot/settings.py +++ b/ubot/settings.py @@ -8,11 +8,11 @@ class Settings(): self.config = SafeConfigParser() self.config.read("settings.ini") - def get_config(self, key): - return self.config.get("DEFAULT", key, fallback=None) + def get_config(self, key, default=None): + return self.config.get("DEFAULT", key, fallback=default) - def get_bool(self, key): - return bool(self.config.get("DEFAULT", key, fallback=False) == "True") + def get_bool(self, key, default=False): + return bool(self.config.get("DEFAULT", key, fallback=default) == "True") def set_config(self, key, value): self.config.set("DEFAULT", key, value)