Skip to content

Commit

Permalink
Merge pull request tweepy#505 from joausaga/master
Browse files Browse the repository at this point in the history
Modify on_data method of StreamListener to process warning messages
  • Loading branch information
Aaron1011 committed Nov 12, 2014
2 parents 3a44f13 + 827b767 commit 5b76b36
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tweepy/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def on_data(self, raw_data):
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))

Expand Down Expand Up @@ -99,7 +102,7 @@ def on_friends(self, friends):
return

def on_limit(self, track):
"""Called when a limitation notice arrvies"""
"""Called when a limitation notice arrives"""
return

def on_error(self, status_code):
Expand All @@ -117,6 +120,10 @@ def on_disconnect(self, notice):
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):
Expand Down

0 comments on commit 5b76b36

Please sign in to comment.