summaryrefslogtreecommitdiff
path: root/voctocore/lib/config.py
blob: fdd236035e0908bd6b6fe46146d1de0d40b4e6f9 (plain)
  1. import os.path
  2. from configparser import SafeConfigParser
  3. from lib.args import Args
  4. __all__ = ['Config']
  5. def getlist(self, section, option):
  6. return [x.strip() for x in self.get(section, option).split(',')]
  7. SafeConfigParser.getlist = getlist
  8. files = [
  9. 'default-config.ini',
  10. '/etc/voctomix.ini',
  11. os.path.expanduser('~/.voctomix.ini'),
  12. ]
  13. if Args.ini_file is not None:
  14. files.append(Args.ini_file)
  15. Config = SafeConfigParser()
  16. Config.read(files)