diff configuration/config.py @ 28:c516ab813079

begin stubbing serialization/deserialization
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 26 Mar 2012 16:54:37 -0700
parents c6d966431498
children fadcc6ab51d4
line wrap: on
line diff
--- a/configuration/config.py	Mon Mar 26 16:40:35 2012 -0700
+++ b/configuration/config.py	Mon Mar 26 16:54:37 2012 -0700
@@ -251,3 +251,21 @@
 
         # return parsed arguments
         return options, args
+
+    ### serialization/deserialization
+
+    def configuration_provider(self, format):
+        """configuration provider guess for a given filename"""
+        for provider in self.configuration_providers:
+            if format in provider.extensions:
+                return provider
+
+    def serialize(self, filename, format=None):
+        """serialize configuration to a file"""
+
+    def deserialize(self, filename, format=None):
+        """load configuration from a file"""
+
+        extension = os.path.splitext(filename)[-1]
+        if not extension:
+            return None