mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-29 03:01:35 +00:00
Final additions for TWBlue 0.50. TWBlue's source code has been frozen
This commit is contained in:
@@ -3,6 +3,7 @@ import threading
|
||||
import wx
|
||||
from twython import TwythonRateLimitError
|
||||
import time
|
||||
from pubsub import pub
|
||||
|
||||
def call_threaded(func, *args, **kwargs):
|
||||
#Call the given function in a daemonized thread and return the thread.
|
||||
@@ -19,3 +20,14 @@ def call_threaded(func, *args, **kwargs):
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
return thread
|
||||
|
||||
def stream_threaded(func, *args, **kwargs):
|
||||
def new_func(*a, **k):
|
||||
try:
|
||||
func(*a, **k)
|
||||
except:
|
||||
pub.sendMessage("streamError")
|
||||
thread = threading.Thread(target=new_func, args=args, kwargs=kwargs)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
return thread
|
Reference in New Issue
Block a user