4 import configparser
as parser
6 import ConfigParser
as parser
11 config = parser.ConfigParser()
12 config.optionxform = str
13 if configfile !=
None:
14 config.read(configfile)
17 def get(self, section, key, default):
18 if self.config.has_option(section, key):
19 return self.config.get(section, key)
23 if self.config.has_option(section, key):
24 return self.config.getboolean(section, key)
27 def getint(self, section, key, default):
28 if self.config.has_option(section, key):
29 return self.config.getint(section, key)
33 if self.config.has_section(section):
34 return self.config.items(section)