Code

include detectors in distro
[roundup.git] / roundup / hyperdb.py
index 56f7ab0cc06dfc590073e5b4942606151fb6e42a..f78be2502611f2b7af025fb3efdfd46e7973ea1e 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: hyperdb.py,v 1.84 2002-10-07 00:52:51 richard Exp $
+# $Id: hyperdb.py,v 1.86 2003-02-26 04:55:57 richard Exp $
 
 """
 Hyperdatabase implementation, especially field types.
@@ -561,6 +561,12 @@ class Class:
         '''
         raise NotImplementedError
 
+class FileClass:
+    ''' A class that requires the "content" property and stores it on
+        disk.
+    '''
+    pass
+
 class Node:
     ''' A convenience wrapper for the given node
     '''
@@ -582,6 +588,11 @@ class Node:
         return l
     def has_key(self, name):
         return self.cl.getprops().has_key(name)
+    def get(self, name, default=None): 
+        if self.has_key(name):
+            return self[name]
+        else:
+            return default
     def __getattr__(self, name):
         if self.__dict__.has_key(name):
             return self.__dict__[name]