Mercurial > hg > configuration
diff configuration/config.py @ 30:b27a7cb2dd5b
stub test for configuration providers
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 26 Mar 2012 17:05:02 -0700 |
parents | fadcc6ab51d4 |
children | 5571d1608cba |
line wrap: on
line diff
--- a/configuration/config.py Mon Mar 26 17:00:12 2012 -0700 +++ b/configuration/config.py Mon Mar 26 17:05:02 2012 -0700 @@ -59,11 +59,11 @@ def _write(self, fp, config): fp.write(json.dumps(config), indent=self.indent, sort_keys=True) # TODO: could use templates to get order down, etc - configuration_providers.append(JSON) + configuration_providers.append(JSON()) if yaml: class YAML(object): - extensions = ['yml'] + extensions = ['yml', 'yaml'] def read(self, filename): f = file(filename) config = yaml.load(f) @@ -73,7 +73,9 @@ fp.write(yaml.dump(config)) # TODO: could use templates to get order down, etc - configuration_providers.append(YAML) + configuration_providers.append(YAML()) + +__all__.extend([i.__class__.__name__ for i in configuration_providers]) ### plugins for option types ### TODO: this could use a bit of thought @@ -275,4 +277,3 @@ if not format: extension = os.path.splitext(filename)[-1] -