1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-24 16:52:06 +00:00
This commit is contained in:
Louis Vézina 2019-12-23 14:03:31 -05:00
parent b41affa267
commit d4fdee1e9f
2 changed files with 7 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import os
from simpleconfigparser import simpleconfigparser
from get_args import args
from six import PY3
defaults = {
'general': {
@ -139,7 +140,10 @@ defaults = {
}
}
settings = simpleconfigparser(defaults=defaults)
if PY3:
settings = simpleconfigparser(defaults=defaults, interpolation=None)
else:
settings = simpleconfigparser(defaults=defaults)
settings.read(os.path.join(args.config_dir, 'config', 'config.ini'))
base_url = settings.general.base_url

View file

@ -26,7 +26,7 @@ THE SOFTWARE.
try:
from configparser import ConfigParser as configparser, NoOptionError, NoSectionError
except ImportError:
from ConfigParser import SafeConfigParser as configparser, NoOptionError, NoSectionError
from ConfigParser import RawConfigParser as configparser, NoOptionError, NoSectionError
class simpleconfigparser(configparser):
@ -126,6 +126,6 @@ class simpleconfigparser(configparser):
def get(self, section, option, raw=False, vars=None, fallback=None):
try:
# Strip out quotes from the edges
return configparser.get(self, section, option, raw=raw, vars=vars).strip('"\'')
return configparser.get(self, section, option).strip('"\'')
except NoOptionError:
return None