changeset 15:35e6e1211c49

don't require receiverhost. we need to open a 2-way connection anyhow Ignore-this: 8b4ad326c2fe67db9b75263b088a2568
author Drew Perttula <drewp@bigasterisk.com>
date Thu, 26 Apr 2018 08:24:27 +0000
parents 6f54302a31d2
children ae91ca39b73f
files rdfdb/syncedgraph.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rdfdb/syncedgraph.py	Thu Apr 26 07:50:56 2018 +0000
+++ b/rdfdb/syncedgraph.py	Thu Apr 26 08:24:27 2018 +0000
@@ -19,6 +19,7 @@
 from rdflib import ConjunctiveGraph
 import logging, cyclone.httpclient, traceback
 from twisted.internet import defer
+import socket
 import treq, json
 log = logging.getLogger('syncedgraph')
 from rdfdb.rdflibpatch import patchQuads
@@ -52,13 +53,16 @@
     pending local changes) and get the data again from the
     server.
     """
-    def __init__(self, rdfdbRoot, receiverHost, label):
+    def __init__(self, rdfdbRoot, label, receiverHost=None):
         """
         label is a string that the server will display in association
         with your connection
 
         receiverHost is the hostname other nodes can use to talk to me
         """
+        if receiverHost is None:
+            receiverHost = socket.gethostname()
+        
         self.rdfdbRoot = rdfdbRoot
         self.initiallySynced = defer.Deferred()
         self._graph = ConjunctiveGraph()