Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
4b48cb9e
Commit
4b48cb9e
authored
Feb 04, 2012
by
Dan Fairs
Browse files
Provide a hook for subclasses to do something when a response closes.
parent
c2edbea6
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
4b48cb9e
...
...
@@ -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!'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment