summaryrefslogtreecommitdiff
path: root/ick2/persistent.py
diff options
context:
space:
mode:
Diffstat (limited to 'ick2/persistent.py')
-rw-r--r--ick2/persistent.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/ick2/persistent.py b/ick2/persistent.py
index d865207..31473ba 100644
--- a/ick2/persistent.py
+++ b/ick2/persistent.py
@@ -27,25 +27,25 @@ import ick2
class PersistentStateInterface: # pragma: no cover
- def get_resource_ids(self, token, kind):
+ def get_resource_ids(self, kind):
raise NotImplementedError()
- def has_resource(self, token, kind, rid):
+ def has_resource(self, kind, rid):
raise NotImplementedError()
- def get_resource(self, token, kind, rid):
+ def get_resource(self, kind, rid):
raise NotImplementedError()
- def get_resources(self, token, kind):
+ def get_resources(self, kind):
return [
- self.get_resource(token, kind, rid)
- for rid in self.get_resource_ids(token, kind)
+ self.get_resource(kind, rid)
+ for rid in self.get_resource_ids(kind)
]
- def write_resource(self, token, kind, rid, resource):
+ def write_resource(self, kind, rid, resource):
raise NotImplementedError()
- def remove_resource(self, token, kind, rid):
+ def remove_resource(self, kind, rid):
raise NotImplementedError()
@@ -54,25 +54,25 @@ class MemoryPersistentState(PersistentStateInterface):
def __init__(self):
self._res = {}
- def get_resource_ids(self, token, kind):
+ def get_resource_ids(self, kind):
if kind not in self._res:
return []
return list(self._res[kind].keys())
- def has_resource(self, token, kind, rid):
+ def has_resource(self, kind, rid):
return kind in self._res and rid in self._res[kind]
- def get_resource(self, token, kind, rid):
+ def get_resource(self, kind, rid):
if kind not in self._res or rid not in self._res[kind]:
raise ick2.NotFound(kind=kind, rid=rid)
return self._res[kind][rid]
- def write_resource(self, token, kind, rid, resource):
+ def write_resource(self, kind, rid, resource):
if kind not in self._res:
self._res[kind] = {}
self._res[kind][rid] = resource
- def remove_resource(self, token, kind, rid):
+ def remove_resource(self, kind, rid):
if kind not in self._res or rid not in self._res[kind]:
raise ick2.NotFound(kind=kind, rid=rid)
del self._res[kind][rid]
@@ -83,25 +83,25 @@ class MuckPersistentState(PersistentStateInterface):
def __init__(self):
self._res = {}
- def get_resource_ids(self, token, kind):
+ def get_resource_ids(self, kind):
if kind not in self._res:
return []
return list(self._res[kind].keys())
- def has_resource(self, token, kind, rid):
+ def has_resource(self, kind, rid):
return kind in self._res and rid in self._res[kind]
- def get_resource(self, token, kind, rid):
+ def get_resource(self, kind, rid):
if kind not in self._res or rid not in self._res[kind]:
raise ick2.NotFound(kind=kind, rid=rid)
return self._res[kind][rid]
- def write_resource(self, token, kind, rid, resource):
+ def write_resource(self, kind, rid, resource):
if kind not in self._res:
self._res[kind] = {}
self._res[kind][rid] = resource
- def remove_resource(self, token, kind, rid):
+ def remove_resource(self, kind, rid):
if kind not in self._res or rid not in self._res[kind]:
raise ick2.NotFound(kind=kind, rid=rid)
del self._res[kind][rid]