mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 21:56:07 -04:00
Remove references to Twython. #351
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user