From 6baf417d3568b8e078b641bb790b7a65b40d9287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sat, 21 Jan 2017 16:06:20 -0600 Subject: [PATCH] Removed old code for proxy support in streaming API modules --- src/twitter/buffers/indibidual.py | 9 +-------- src/twitter/buffers/stream.py | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/twitter/buffers/indibidual.py b/src/twitter/buffers/indibidual.py index 6dbed956..0a0be8c9 100644 --- a/src/twitter/buffers/indibidual.py +++ b/src/twitter/buffers/indibidual.py @@ -10,14 +10,7 @@ log = original_logger.getLogger("TimelinesStream") class timelinesStreamer(TwythonStreamer): def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, timeout=300, retry_count=None, retry_in=10, client_args=None, handlers=None, chunk_size=1, session=None): self.session = session - args = None - if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "": - args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]), - "https": "https://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"])}} - if config.app["proxy"]["user"] != "" and config.app["proxy"]["password"] != "": - auth = HTTPProxyAuth(config.app["proxy"]["user"], config.app["proxy"]["password"]) - args["auth"] = auth - super(timelinesStreamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, timeout=60, retry_count=None, retry_in=180, client_args=args, handlers=None, chunk_size=1) + super(timelinesStreamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, timeout=60, retry_count=None, retry_in=180, handlers=None, chunk_size=1) self.lists = self.session.lists def on_error(self, status_code, data): diff --git a/src/twitter/buffers/stream.py b/src/twitter/buffers/stream.py index 438ffe93..77929082 100644 --- a/src/twitter/buffers/stream.py +++ b/src/twitter/buffers/stream.py @@ -9,14 +9,7 @@ log = original_logger.getLogger("MainStream") class streamer(TwythonStreamer): def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, sessionObject, *a, **kw): - args = None - if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "": - args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]), - "https": "https://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"])}} - if config.app["proxy"]["user"] != "" and config.app["proxy"]["password"] != "": - auth = HTTPProxyAuth(config.app["proxy"]["user"], config.app["proxy"]["password"]) - args["auth"] = auth - super(streamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, client_args=args, *a, **kw) + super(streamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, *a, **kw) self.session = sessionObject self.muted_users = self.session.db["muted_users"] # self.blocked_users = []