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
5b76b365
Commit
5b76b365
authored
Nov 12, 2014
by
Aaron1011
Browse files
Merge pull request #505 from joausaga/master
Modify on_data method of StreamListener to process warning messages
parents
3a44f136
827b767e
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/streaming.py
View file @
5b76b365
...
...
@@ -68,6 +68,9 @@ class StreamListener(object):
elif
'disconnect'
in
data
:
if
self
.
on_disconnect
(
data
[
'disconnect'
])
is
False
:
return
False
elif
'warning'
in
data
:
if
self
.
on_warning
(
data
[
'warning'
])
is
False
:
return
False
else
:
logging
.
error
(
"Unknown message type: "
+
str
(
raw_data
))
...
...
@@ -99,7 +102,7 @@ class StreamListener(object):
return
def
on_limit
(
self
,
track
):
"""Called when a limitation notice arr
v
ies"""
"""Called when a limitation notice arri
v
es"""
return
def
on_error
(
self
,
status_code
):
...
...
@@ -117,6 +120,10 @@ class StreamListener(object):
https://dev.twitter.com/docs/streaming-apis/messages#Disconnect_messages_disconnect
"""
return
def
on_warning
(
self
,
notice
):
"""Called when a disconnection warning message arrives"""
return
class
ReadBuffer
(
object
):
...
...
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