def createAndReadConfig(name, forPlatform=1): """ Return an initialised ConfigFile object """ confFile = os.path.join(Preferences.rcPath, '%s%s.cfg' % (name, forPlatform and '.'+Preferences.thisPlatform or '')) if not confFile in _sharedConfs: conf = ConfigParser() conf.read(confFile) conf.confFile = confFile _sharedConfs[confFile] = conf return _sharedConfs[confFile]