projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2edbea
)
Provide a hook for subclasses to do something when a response closes.
author
Dan Fairs
<dan@fezconsulting.com>
Sat, 4 Feb 2012 16:22:56 +0000
(16:22 +0000)
committer
Dan Fairs
<dan@fezconsulting.com>
Sat, 4 Feb 2012 16:22:56 +0000
(16:22 +0000)
tweepy/streaming.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/streaming.py
b/tweepy/streaming.py
index 6f8b4a69f86152142a71495442425b52d92aaf9c..dd144aaf35dc7adc7e0deba30487a89808f88cb4 100644
(file)
--- a/
tweepy/streaming.py
+++ b/
tweepy/streaming.py
@@
-157,6
+157,8
@@
class Stream(object):
# buffer
buf += c
+ if resp.isclosed():
+ self.on_closed(resp)
def _start(self, async):
self.running = True
@@
-165,6
+167,10
@@
class Stream(object):
else:
self._run()
+ def on_closed(self, resp):
+ """ Called when the response has been closed by Twitter """
+ pass
+
def userstream(self, count=None, async=False, secure=True):
if self.running:
raise TweepError('Stream object already connected!')