[engine] Use RawConfigParser instead of SafeConfigParser

To allow percent signs in the config file
This commit is contained in:
Frederic Junod 2017-07-14 09:01:13 +02:00
parent fe9c2835ad
commit effea548ce

View file

@ -11,9 +11,9 @@ import bumblebee.modules
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
try: try:
from ConfigParser import SafeConfigParser from ConfigParser import RawConfigParser
except ImportError: except ImportError:
from configparser import SafeConfigParser from configparser import RawConfigParser
def all_modules(): def all_modules():
"""Return a list of available modules""" """Return a list of available modules"""
@ -41,7 +41,7 @@ class Module(object):
self._configFile = None self._configFile = None
for cfg in [ os.path.expanduser("~/.bumblebee-status.conf"), os.path.expanduser("~/.config/bumblebee-status.conf") ]: for cfg in [ os.path.expanduser("~/.bumblebee-status.conf"), os.path.expanduser("~/.config/bumblebee-status.conf") ]:
if os.path.exists(cfg): if os.path.exists(cfg):
self._configFile = SafeConfigParser() self._configFile = RawConfigParser()
self._configFile.read(cfg) self._configFile.read(cfg)
break break