add removePeer to interface
This commit is contained in:
parent
de1dc507ac
commit
23ce278f8a
2 changed files with 9 additions and 0 deletions
|
@ -44,3 +44,9 @@ class DictDataStore(UserDict.DictMixin):
|
|||
def getPeersForBlob(self, key):
|
||||
if key in self._dict:
|
||||
return [val[0] for val in self._dict[key]]
|
||||
|
||||
def removePeer(self, value):
|
||||
for key in self._dict:
|
||||
self._dict[key] = [val for val in self._dict[key] if val[0] != value]
|
||||
if not self._dict[key]:
|
||||
del self._dict[key]
|
||||
|
|
|
@ -24,6 +24,9 @@ class IDataStore(Interface):
|
|||
def getPeersForBlob(self, key):
|
||||
pass
|
||||
|
||||
def removePeer(self, key):
|
||||
pass
|
||||
|
||||
|
||||
class IRoutingTable(Interface):
|
||||
""" Interface for RPC message translators/formatters
|
||||
|
|
Loading…
Add table
Reference in a new issue