add removePeer to interface

This commit is contained in:
Jack Robison 2017-10-10 13:27:44 -04:00
parent de1dc507ac
commit 23ce278f8a
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
2 changed files with 9 additions and 0 deletions

View file

@ -44,3 +44,9 @@ class DictDataStore(UserDict.DictMixin):
def getPeersForBlob(self, key): def getPeersForBlob(self, key):
if key in self._dict: if key in self._dict:
return [val[0] for val in self._dict[key]] 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]

View file

@ -24,6 +24,9 @@ class IDataStore(Interface):
def getPeersForBlob(self, key): def getPeersForBlob(self, key):
pass pass
def removePeer(self, key):
pass
class IRoutingTable(Interface): class IRoutingTable(Interface):
""" Interface for RPC message translators/formatters """ Interface for RPC message translators/formatters