pull/717/head
Louis Vézina 5 years ago
parent b41affa267
commit d4fdee1e9f

@ -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

@ -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

Loading…
Cancel
Save