X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=apt_dht_Khashmir%2Fkhashmir.py;h=5d40dee9123c88ad087933ce38e273b5a36ec89c;hb=e6cb61cfc53cc379909c64396f338505011203d4;hp=af6f0d8817156d0eba8af78feb2c4e320af2346f;hpb=07893ed1ffd3cdcc1a8b51d0854599d61b2b5fac;p=quix0rs-apt-p2p.git diff --git a/apt_dht_Khashmir/khashmir.py b/apt_dht_Khashmir/khashmir.py index af6f0d8..5d40dee 100644 --- a/apt_dht_Khashmir/khashmir.py +++ b/apt_dht_Khashmir/khashmir.py @@ -30,7 +30,7 @@ class KhashmirBase(protocol.Factory): def setup(self, config, cache_dir): self.config = config self.port = config['PORT'] - self.store = DB(os.path.join(cache_dir, '.khashmir.' + str(self.port) + '.db')) + self.store = DB(os.path.join(cache_dir, 'khashmir.' + str(self.port) + '.db')) self.node = self._loadSelfNode('', self.port) self.table = KTable(self.node, config) #self.app = service.Application("krpc") @@ -210,7 +210,7 @@ class KhashmirBase(protocol.Factory): n = self.Node(id, _krpc_sender[0], _krpc_sender[1]) self.insertNode(n, contacted=0) nodes = self.table.findNodes(target) - nodes = map(lambda node: node.senderDict(), nodes) + nodes = map(lambda node: node.contactInfo(), nodes) return {"nodes" : nodes, "id" : self.node.id} @@ -249,7 +249,7 @@ class KhashmirRead(KhashmirBase): return {'values' : l, "id": self.node.id} else: nodes = self.table.findNodes(key) - nodes = map(lambda node: node.senderDict(), nodes) + nodes = map(lambda node: node.contactInfo(), nodes) return {'nodes' : nodes, "id": self.node.id} ### provides a generic write method, you probably don't want to deploy something that allows @@ -258,7 +258,7 @@ class KhashmirWrite(KhashmirRead): _Node = KNodeWrite ## async, callback indicates nodes we got a response from (but no guarantee they didn't drop it on the floor) def storeValueForKey(self, key, value, callback=None): - """ stores the value for key in the global table, returns immediately, no status + """ stores the value and origination time for key in the global table, returns immediately, no status in this implementation, peers respond but don't indicate status to storing values a key can have many values """