# HG changeset patch # User Drew Perttula # Date 1524731067 0 # Node ID 35e6e1211c49db2053cfb133aa88241bf8a18934 # Parent 6f54302a31d251a204864ea0dcc41a04171e9990 don't require receiverhost. we need to open a 2-way connection anyhow Ignore-this: 8b4ad326c2fe67db9b75263b088a2568 diff -r 6f54302a31d2 -r 35e6e1211c49 rdfdb/syncedgraph.py --- 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()