示例#1
0
    def __init__(self):

        # Load the config file:
        if ScriptFlags.MREORG_MPLCONFIG_FILE:
            from configobj import ConfigObj
            config = ConfigObj(ScriptFlags.MREORG_MPLCONFIG_FILE,interpolation='template')
            config.interpolation = 'template'

            for k in config.get('layouts', {}):
                self.__dict__[str(k)] = config['layouts'][k]
示例#2
0
文件: config.py 项目: alexhock/WTF
def get_config(argv):

    config = None
    config_file_name = "./config.ini"

    if len(argv) > 1:
        config_file_name = argv[1]

    try:
        config = ConfigObj(config_file_name, file_error=True)
        config.interpolation = True
    except (ConfigObjError, IOError), e:
        print("Error could not read {0}: {1}".format(config_file_name, e))
        exit(1)