Allow passing custom API instance into stream listener.
authorJoshua <jroesslein@gmail.com>
Mon, 30 Nov 2009 05:19:31 +0000 (23:19 -0600)
committerJoshua <jroesslein@gmail.com>
Mon, 30 Nov 2009 05:19:31 +0000 (23:19 -0600)
tweepy/streaming.py

index 98d7057784f270ebd6f12b1217f812fba76237a2..bd871c6e6e8cb90866680b7182910a422b52c329 100644 (file)
@@ -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.