Mercurial > code > home > repos > light9
changeset 1343:a214a9d6f2f0
refactor rdfdb: Client doesn't need Db at construction
Ignore-this: 9a3591d13c4ff821dd6e543bf78f8583
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sun, 05 Jun 2016 00:35:32 +0000 |
parents | aa97bc796f2d |
children | 01f7ece0cb13 |
files | bin/rdfdb |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/rdfdb Sun Jun 05 00:14:16 2016 +0000 +++ b/bin/rdfdb Sun Jun 05 00:35:32 2016 +0000 @@ -133,21 +133,19 @@ """ one of our syncedgraph clients """ - def __init__(self, updateUri, label, db): - self.db = db + def __init__(self, updateUri, label): self.label = label self.updateUri = updateUri - self.sendAll() def __repr__(self): return "<%s client at %s>" % (self.label, self.updateUri) - def sendAll(self): + def sendAll(self, graph): """send the client the whole graph contents""" log.info("sending all graphs to %s at %s" % (self.label, self.updateUri)) self.sendPatch(Patch( - addQuads=self.db.graph.quads(ALLSTMTS), + addQuads=graph.quads(ALLSTMTS), delQuads=[])) def sendPatch(self, p): @@ -337,7 +335,9 @@ for c in self.clients if c.updateUri == updateUri] log.info("new client %s at %s" % (label, updateUri)) - self.clients.append(Client(updateUri, label, self)) + c = Client(updateUri, label) + c.sendAll(self.graph) + self.clients.append(c) self.sendClientsToAllLivePages() def sendClientsToAllLivePages(self):