comparison lib/patchsource.py @ 1250:81ab17e377b7

patchsource py3 support. might break py2 Ignore-this: e7559afeb74ffa53bf2085f78455014 darcs-hash:3bc2fc52891ea205aa79f89a16d3d7b341cda35e
author drewp <drewp@bigasterisk.com>
date Thu, 18 Apr 2019 21:58:19 -0700
parents 24c004aac998
children 47f309d8ba94
comparison
equal deleted inserted replaced
1249:2ddfb2cf95ab 1250:81ab17e377b7
27 log.info('start read from %s', url) 27 log.info('start read from %s', url)
28 # note: fullGraphReceived isn't guaranteed- the stream could 28 # note: fullGraphReceived isn't guaranteed- the stream could
29 # start with patches 29 # start with patches
30 self._fullGraphReceived = False 30 self._fullGraphReceived = False
31 self._eventSource = EventSource(url.toPython().encode('utf8')) 31 self._eventSource = EventSource(url.toPython().encode('utf8'))
32 self._eventSource.protocol.delimiter = '\n' 32 self._eventSource.protocol.delimiter = b'\n'
33 33
34 self._eventSource.addEventListener('fullGraph', self._onFullGraph) 34 self._eventSource.addEventListener('fullGraph', self._onFullGraph)
35 self._eventSource.addEventListener('patch', self._onPatch) 35 self._eventSource.addEventListener('patch', self._onPatch)
36 self._eventSource.onerror(self._onError) 36 self._eventSource.onerror(self._onError)
37 37