Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Get a list of all feature names from the _ConfigFile subclass
'klass'.  Return a list of tuples, each of which contains all the
synonyms for a single feature.

        def getFeatureList(klass):
    """Get a list of all feature names from the _ConfigFile subclass
       'klass'.  Return a list of tuples, each of which contains all the
       synonyms for a single feature."""
    syn = klass._syntax
    features = []
    for secname, secitems in syn.items():
        for entname in secitems.keys():
            if entname.startswith("__"): continue
            synonyms = []
            synonyms.append("%s:%s"%(secname,entname))
            unique = 1
            for sn, si in syn.items():
                if sn != secname and si.has_key(entname):
                    unique = 0
                    break
            if unique:
                synonyms.append(entname)
            features.append(tuple(synonyms))
    features.sort()
    return features
        


src/m/i/mixminion-HEAD/lib/mixminion/ClientMain.py   mixminion(Download)
 
    if listFeatures:
        features = mixminion.Config.getFeatureList(ServerInfo)
        features.append(("caps",))
        features.append(("status",))