Mercurial > code > home > repos > homeauto
diff service/reasoning/patchsource.py @ 312:170dc9b1e789
fix input graph web display by dirtying combinedGraph better.
Ignore-this: e40e7499e3d675b029f829a1f269b83a
author | drewp@bigasterisk.com |
---|---|
date | Sun, 09 Oct 2016 13:57:50 -0700 |
parents | 6aad04b34231 |
children |
line wrap: on
line diff
--- a/service/reasoning/patchsource.py Fri Sep 16 01:28:48 2016 -0700 +++ b/service/reasoning/patchsource.py Sun Oct 09 13:57:50 2016 -0700 @@ -1,4 +1,4 @@ -import sys +import sys, logging import traceback from twisted.internet import reactor, defer from twisted_sse_demo.eventsource import EventSource @@ -6,12 +6,12 @@ from rdflib.parser import StringInputSource sys.path.append("../../lib") -from logsetup import log from patchablegraph import patchFromJson sys.path.append("/my/proj/light9") from light9.rdfdb.patch import Patch +log = logging.getLogger('fetch') class PatchSource(object): """wrap EventSource so it emits Patch objects and has an explicit stop method.""" @@ -25,6 +25,8 @@ self._listeners = set() log.info('start read from %s', url) + # note: fullGraphReceived isn't guaranteed- the stream could + # start with patches self._fullGraphReceived = False self._eventSource = EventSource(url.toPython().encode('utf8')) self._eventSource.protocol.delimiter = '\n'