mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 20:53:13 -06:00
Merge branch 'next-gen' into proxy
This commit is contained in:
commit
2459a499ce
@ -1,13 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
from future import standard_library
|
|
||||||
standard_library.install_aliases()
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger("mysc.thread_utils")
|
log = logging.getLogger("mysc.thread_utils")
|
||||||
import threading
|
import threading
|
||||||
import wx
|
import wx
|
||||||
from pubsub import pub
|
from pubsub import pub
|
||||||
from twython import TwythonRateLimitError
|
|
||||||
|
|
||||||
def call_threaded(func, *args, **kwargs):
|
def call_threaded(func, *args, **kwargs):
|
||||||
#Call the given function in a daemonized thread and return the thread.
|
#Call the given function in a daemonized thread and return the thread.
|
||||||
@ -23,17 +19,3 @@ def call_threaded(func, *args, **kwargs):
|
|||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
return thread
|
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()
|
|
||||||
return thread
|
|
@ -1,8 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
from builtins import str
|
|
||||||
from builtins import object
|
|
||||||
import shutil
|
import shutil
|
||||||
import widgetUtils
|
import widgetUtils
|
||||||
import platform
|
import platform
|
||||||
@ -21,7 +17,7 @@ from sessions.twitter import session
|
|||||||
from . import manager
|
from . import manager
|
||||||
import config_utils
|
import config_utils
|
||||||
import config
|
import config
|
||||||
from twython.exceptions import TwythonAuthError
|
from tweepy.error import TweepError
|
||||||
log = logging.getLogger("sessionmanager.sessionManager")
|
log = logging.getLogger("sessionmanager.sessionManager")
|
||||||
|
|
||||||
class sessionManagerController(object):
|
class sessionManagerController(object):
|
||||||
@ -87,7 +83,7 @@ class sessionManagerController(object):
|
|||||||
if i not in config.app["sessions"]["ignored_sessions"]:
|
if i not in config.app["sessions"]["ignored_sessions"]:
|
||||||
try:
|
try:
|
||||||
s.login()
|
s.login()
|
||||||
except TwythonAuthError:
|
except TweepError:
|
||||||
self.show_auth_error(s.settings["twitter"]["user_name"])
|
self.show_auth_error(s.settings["twitter"]["user_name"])
|
||||||
continue
|
continue
|
||||||
sessions.sessions[i] = s
|
sessions.sessions[i] = s
|
||||||
|
Loading…
Reference in New Issue
Block a user