Skip to content

Commit

Permalink
Extend simpleconfigparser to not strip quotes from the string value
Browse files Browse the repository at this point in the history
This is a suggestion fix for #309
  • Loading branch information
ratoaq2 authored Apr 13, 2021
1 parent aca3214 commit 8e91bee
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bazarr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@

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',
Expand Down Expand Up @@ -172,7 +182,7 @@
}
}

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 '/'
Expand Down

0 comments on commit 8e91bee

Please sign in to comment.