-
Notifications
You must be signed in to change notification settings - Fork 572
Expand file tree
/
Copy pathstorage.py
More file actions
48 lines (34 loc) · 1.2 KB
/
storage.py
File metadata and controls
48 lines (34 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import collections
InventoryItem = collections.namedtuple('InventoryItem', 'type stream payload expires tag')
class Storage(object):
pass
# def __init__(self):
# super(self.__class__, self).__init__()
class InventoryStorage(Storage, collections.MutableMapping):
def __init__(self):
# super(self.__class__, self).__init__()
self.numberOfInventoryLookupsPerformed = 0
def __contains__(self, hash):
raise NotImplementedError
def __getitem__(self, hash):
raise NotImplementedError
def __setitem__(self, hash, value):
raise NotImplementedError
def __delitem__(self, hash):
raise NotImplementedError
def __iter__(self):
raise NotImplementedError
def __len__(self):
raise NotImplementedError
def by_type_and_tag(self, objectType, tag):
raise NotImplementedError
def unexpired_hashes_by_stream(self, stream):
raise NotImplementedError
def flush(self):
raise NotImplementedError
def clean(self):
raise NotImplementedError
class MailboxStorage(Storage, collections.MutableMapping):
def __init__(self):
# super(self.__class__, self).__init__()
pass