mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-06 06:52:07 +08:00
Extend simpleconfigparser to not strip quotes from the string value
This is a suggestion fix for #309
This commit is contained in:
parent
aca3214dbf
commit
8e91beed83
1 changed files with 12 additions and 2 deletions
|
@ -8,10 +8,20 @@ from urllib.parse import quote_plus
|
||||||
|
|
||||||
from subliminal.cache import region
|
from subliminal.cache import region
|
||||||
|
|
||||||
from simpleconfigparser import simpleconfigparser
|
from simpleconfigparser import simpleconfigparser, configparser, NoOptionError
|
||||||
|
|
||||||
from get_args import args
|
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 = {
|
defaults = {
|
||||||
'general': {
|
'general': {
|
||||||
'ip': '0.0.0.0',
|
'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.read(os.path.join(args.config_dir, 'config', 'config.ini'))
|
||||||
|
|
||||||
settings.general.base_url = settings.general.base_url if settings.general.base_url else '/'
|
settings.general.base_url = settings.general.base_url if settings.general.base_url else '/'
|
||||||
|
|
Loading…
Reference in a new issue