changeset 1344:01f7ece0cb13

refactor rdfdb: Db doesn't make Client objects Ignore-this: 205ebf0d96f84d12df5dd88798ad097e
author Drew Perttula <drewp@bigasterisk.com>
date Sun, 05 Jun 2016 00:43:21 +0000
parents a214a9d6f2f0
children 13f758eda3b4
files bin/rdfdb
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/bin/rdfdb	Sun Jun 05 00:35:32 2016 +0000
+++ b/bin/rdfdb	Sun Jun 05 00:43:21 2016 +0000
@@ -330,14 +330,13 @@
             g.add(s)
         return g
 
-    def addClient(self, updateUri, label):
+    def addClient(self, newClient):
         [self.clients.remove(c)
-         for c in self.clients if c.updateUri == updateUri]
+         for c in self.clients if c.updateUri == newClient.updateUri]
 
-        log.info("new client %s at %s" % (label, updateUri))
-        c = Client(updateUri, label)
-        c.sendAll(self.graph)
-        self.clients.append(c)
+        log.info("new client %s at %s" % (newClient.label, newClient.updateUri))
+        newClient.sendAll(self.graph)
+        self.clients.append(newClient)
         self.sendClientsToAllLivePages()
 
     def sendClientsToAllLivePages(self):
@@ -371,7 +370,7 @@
     def post(self):
         upd = self.get_argument("clientUpdate")
         try:
-            self.settings.db.addClient(upd, self.get_argument("label"))
+            self.settings.db.addClient(Client(upd, self.get_argument("label")))
         except:
             import traceback
             traceback.print_exc()