kumistatus/setuptools/__init__.py

19 lines
491 B
Python
Raw Normal View History

import ast, configparser
2016-03-16 12:49:28 +00:00
conffile = "config.cfg"
2016-03-16 12:49:28 +00:00
class SetupException(Exception):
def __str__(self):
return "Seems like config.cfg has not been created yet. Run setup.py to do so."
def getSetting(section, setting):
config = configparser.RawConfigParser()
config.read(conffile)
2016-03-16 12:49:28 +00:00
return config.get(section, setting)
def getListSetting(section, setting):
config = configparser.RawConfigParser()
config.read(conffile)
lit = config.get(section, setting)
return ast.literal_eval(lit)