cache is always a dictionary in memory
[tiramisu.git] / tiramisu / storage / dictionary / setting.py
index 519c844..706ab2a 100644 (file)
@@ -17,7 +17,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 # ____________________________________________________________
-from tiramisu.storage.dictionary.storage import Cache
+from ..cache import Cache
 
 
 class Settings(Cache):
@@ -29,24 +29,24 @@ class Settings(Cache):
         self._properties = {}
         # permissive properties
         self._permissives = {}
-        super(Settings, self).__init__()
+        super(Settings, self).__init__(storage)
 
     # propertives
-    def setproperties(self, opt, properties):
-        self._properties[opt] = properties
+    def setproperties(self, path, properties):
+        self._properties[path] = properties
 
-    def getproperties(self, opt, default_properties):
-        return self._properties.get(opt, set(default_properties))
+    def getproperties(self, path, default_properties):
+        return self._properties.get(path, set(default_properties))
 
-    def hasproperties(self, opt):
-        return opt in self._properties
+    def hasproperties(self, path):
+        return path in self._properties
 
     def reset_all_propertives(self):
         self._properties.clear()
 
-    def reset_properties(self, opt):
+    def reset_properties(self, path):
         try:
-            del(self._properties[opt])
+            del(self._properties[path])
         except KeyError:
             pass
 
@@ -54,8 +54,8 @@ class Settings(Cache):
         return self._properties
 
     # permissive
-    def setpermissive(self, opt, permissive):
-        self._permissives[opt] = frozenset(permissive)
+    def setpermissive(self, path, permissive):
+        self._permissives[path] = frozenset(permissive)
 
-    def getpermissive(self, opt=None):
-        return self._permissives.get(opt, frozenset())
+    def getpermissive(self, path=None):
+        return self._permissives.get(path, frozenset())