diff options
author | Rato <[email protected]> | 2021-04-13 06:00:49 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-13 00:00:49 -0400 |
commit | 8e91beed83e6b5a4bec680d15b226a77ff3e224e (patch) | |
tree | 71d48ba48f456f79f976a068920e9036e2b88887 | |
parent | aca3214dbfe778270a04fafaa443173852544492 (diff) | |
download | bazarr-8e91beed83e6b5a4bec680d15b226a77ff3e224e.tar.gz bazarr-8e91beed83e6b5a4bec680d15b226a77ff3e224e.zip |
Extend simpleconfigparser to not strip quotes from the string value
This is a suggestion fix for #309
-rw-r--r-- | bazarr/config.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bazarr/config.py b/bazarr/config.py index 98711824e..216e8fc48 100644 --- a/bazarr/config.py +++ b/bazarr/config.py @@ -8,10 +8,20 @@ from urllib.parse import quote_plus from subliminal.cache import region -from simpleconfigparser import simpleconfigparser +from simpleconfigparser import simpleconfigparser, configparser, NoOptionError from get_args import args + +class SimpleConfigParser(simpleconfigparser): + + def get(self, section, option, raw=False, vars=None): + try: + return configparser.get(self, section, option, raw=raw, vars=vars) + except NoOptionError: + return None + + defaults = { 'general': { 'ip': '0.0.0.0', @@ -172,7 +182,7 @@ defaults = { } } -settings = simpleconfigparser(defaults=defaults, interpolation=None) +settings = SimpleConfigParser(defaults=defaults, interpolation=None) settings.read(os.path.join(args.config_dir, 'config', 'config.ini')) settings.general.base_url = settings.general.base_url if settings.general.base_url else '/' |