From: Joshua Date: Mon, 30 Nov 2009 05:19:31 +0000 (-0600) Subject: Allow passing custom API instance into stream listener. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9bec365a93dd0cd4e5f0dde26aa22dd917a33fa0;p=tweepy.git Allow passing custom API instance into stream listener. --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 98d7057..bd871c6 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -29,8 +29,8 @@ STREAM_VERSION = 1 class StreamListener(object): - def __init__(self): - self.api = API() + def __init__(self, api=None): + self.api = api or API() def on_data(self, data): """Called when raw data is received from connection.