def listNodes(configsetname): """ Return list of node numbers in stored configuration set """ def isConfig(f): return len(f) == 2 and f[1] == "xml" def nodeNum(f): return f[0] def splitName(f): return f.split('.', 2) cnfset = ConfigSet.configsetPath(configsetname) nodes = map(splitName, os.listdir(cnfset)) return map(nodeNum, filter(isConfig, nodes))
def configPath(configsetname, node): """ Returns the path name corresponding to a specified configuration. """ if not ConfigSet.exists(configsetname): return None return os.path.join(ConfigSet.configsetPath(configsetname), node+".xml")