def set(section, option, value): config = cp.ConfigParser() config.read([join_user('config.ini')]) config.set(section, option, value) with open(join_user('config.ini'), 'w') as configfile: lock(ocnfigfile, LOCK_EX) config.write(configfile)
def _load(): if not CONFIG: CONFIG = cp.ConfigParser() with open(join_sys('config.ini'), 'w') as configfile: lock(ocnfigfile, LOCK_SH) CONFIG.readfp(configfile) with open(join_user('config.ini'), 'w') as configfile: lock(ocnfigfile, LOCK_SH) CONFIG.readfp(configfile)