From e2931e96eb74f1e0049e9ff2ce2c1cf6cab77c0e Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Fri, 22 Jan 2021 10:55:08 -0600 Subject: [PATCH] Remove references to Twython. #351 --- src/mysc/thread_utils.py | 18 ------------------ src/sessionmanager/sessionManager.py | 8 ++------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/mysc/thread_utils.py b/src/mysc/thread_utils.py index 932f53c9..3a112e33 100644 --- a/src/mysc/thread_utils.py +++ b/src/mysc/thread_utils.py @@ -1,13 +1,9 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals -from future import standard_library -standard_library.install_aliases() import logging log = logging.getLogger("mysc.thread_utils") import threading import wx from pubsub import pub -from twython import TwythonRateLimitError def call_threaded(func, *args, **kwargs): #Call the given function in a daemonized thread and return the thread. @@ -19,20 +15,6 @@ def call_threaded(func, *args, **kwargs): except: log.exception("Thread %d with function %r, args of %r, and kwargs of %r failed to run." % (threading.current_thread().ident, func, a, k)) # pass - thread = threading.Thread(target=new_func, args=args, kwargs=kwargs) - thread.daemon = True - thread.start() - return thread - -def stream_threaded(func, *args, **kwargs): - def new_func(*a, **k): - try: - func(**k) - except Exception as msg: - log.error("Error in stream with args: %r" % (a,)) - log.error(msg.message) - pub.sendMessage("stream-error", session=a[0]) - thread = threading.Thread(target=new_func, args=args, kwargs=kwargs) thread.daemon = True thread.start() diff --git a/src/sessionmanager/sessionManager.py b/src/sessionmanager/sessionManager.py index d6a39c90..73757e4f 100644 --- a/src/sessionmanager/sessionManager.py +++ b/src/sessionmanager/sessionManager.py @@ -1,8 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals -from builtins import str -from builtins import object import shutil import widgetUtils import platform @@ -21,7 +17,7 @@ from sessions.twitter import session from . import manager import config_utils import config -from twython.exceptions import TwythonAuthError +from tweepy.error import TweepError log = logging.getLogger("sessionmanager.sessionManager") class sessionManagerController(object): @@ -87,7 +83,7 @@ class sessionManagerController(object): if i not in config.app["sessions"]["ignored_sessions"]: try: s.login() - except TwythonAuthError: + except TweepError: self.show_auth_error(s.settings["twitter"]["user_name"]) continue sessions.sessions[i] = s