2016-12-06 11:01:17 +01:00
|
|
|
from ConfigParser import SafeConfigParser, ConfigParser
|
2016-12-06 10:47:39 +01:00
|
|
|
|
|
|
|
class BMConfigParser(SafeConfigParser):
|
|
|
|
def set(self, section, option, value=None):
|
2016-12-06 11:01:17 +01:00
|
|
|
if self._optcre is self.OPTCRE or value:
|
|
|
|
if not isinstance(value, basestring):
|
|
|
|
raise TypeError("option values must be strings")
|
|
|
|
return ConfigParser.set(self, section, option, value)
|
|
|
|
|
|
|
|
def get(self, section, option, raw=False, vars=None):
|
|
|
|
return ConfigParser.get(self, section, option, True, vars)
|
|
|
|
|
|
|
|
def items(self, section, raw=False, vars=None):
|
|
|
|
return ConfigParser.items(self, section, True, vars)
|
|
|
|
|