added BaseVersion class
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 29 Sep 2011 20:44:16 +0000 (16:44 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 29 Sep 2011 20:44:16 +0000 (16:44 -0400)
sfa/rspecs/rspec_version.py [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index e6cdcec..c91de47
@@ -1,6 +1,28 @@
 #!/usr/bin/python
 from sfa.util.sfalogging import logger
 
+class BaseVersion:
+    type = None
+    content_type = None
+    version = None
+    schema = None
+    naemspace = None
+    extensions = {}
+    elements = []
+
+    def to_dict(self):
+        return {
+            'type': self.type,
+            'version': self.version,
+            'schema': self.schema,
+            'namespace': self.namespace,
+            'extensions': self.extensions
+        }
+
+    def to_string(self):
+        return "%s %s" % (self.type, self.version)
+    
+
 class RSpecVersion(dict):
 
     fields = {'type': None,