changeset 5:7910b0ef0bab

stub configuration providers
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 24 Mar 2012 22:25:24 -0700
parents 92e1b2dd60c8
children dce954a3831f
files configuration/config.py
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configuration/config.py	Sat Mar 24 22:14:59 2012 -0700
+++ b/configuration/config.py	Sat Mar 24 22:25:24 2012 -0700
@@ -7,6 +7,7 @@
 import sys
 import optparse
 
+# imports for contigent configuration providers
 try:
     import json
 except ImportError:
@@ -14,6 +15,23 @@
         import simplejson as json
     except ImportError:
         json = None
+try:
+    import yaml
+except ImportError:
+    yaml = None
+
+configuration_providers = []
+if json:
+    class JSON(object):
+        extensions = ['json']
+    configuration_providers.append(JSON)
+
+if yaml:
+    class YAML(object):
+        extensions = ['yml']
+        def read(self, filename):
+            pass
+    configuration_providers.append(YAML)
 
 __all__ = ['Configuration']