Author: dmeyer
Date: Fri Jan 18 14:07:37 2008
New Revision: 2979
Log:
remove BackgroundTask
Modified:
trunk/base/src/notifier/__init__.py
trunk/base/src/notifier/async.py
Modified: trunk/base/src/notifier/__init__.py
==============================================================================
--- trunk/base/src/notifier/__init__.py (original)
+++ trunk/base/src/notifier/__init__.py Fri Jan 18 14:07:37 2008
@@ -38,7 +38,7 @@
from event import Event, EventHandler, WeakEventHandler
from yieldfunc import YieldContinue, YieldCallback, YieldFunction,
yield_execution
from jobserver import NamedThreadCallback, execute_in_thread
-from async import InProgress, BackgroundTask
+from async import InProgress
from decorators import execute_in_timer, execute_in_mainloop
# Here's what will be imported into the kaa namespace.
@@ -48,7 +48,7 @@
'OneShotAtTimer', 'SocketDispatcher', 'WeakSocketDispatcher', 'Socket',
'IO_READ', 'IO_WRITE', 'Event', 'EventHandler', 'WeakEventHandler',
'YieldContinue', 'YieldCallback', 'YieldFunction', 'NamedThreadCallback',
- 'InProgress', 'BackgroundTask',
+ 'InProgress',
# decorator for sub modules
# FIXME: while we are breaking the API right now, do we want to keep
Modified: trunk/base/src/notifier/async.py
==============================================================================
--- trunk/base/src/notifier/async.py (original)
+++ trunk/base/src/notifier/async.py Fri Jan 18 14:07:37 2008
@@ -29,7 +29,7 @@
#
# -----------------------------------------------------------------------------
-__all__ = [ 'InProgress', 'BackgroundTask' ]
+__all__ = [ 'InProgress' ]
# python imports
import logging
@@ -200,32 +200,3 @@
will be emited only once.
"""
return Signal._connect(self, callback, args, kwargs, True, weak, pos)
-
-
-class BackgroundTask(object):
- """
- Task running in the background. This objects provides a 'completed' and
- an 'exception' signal and a decorator to create an InProgress object.
- """
- def __init__(self):
- self.signals = {
- 'completed': Signal(),
- 'exception': Signal()
- }
-
- def start_background_task():
- def decorator(func):
- def newfunc(self, *args, **kwargs):
- async = InProgress()
- self.signals['completed'].connect_weak_once(async.finished)
- self.signals['exception'].connect_weak_once(async.exception)
- func(self, *args, **kwargs)
- return async
- try:
- newfunc.func_name = func.func_name
- except TypeError:
- pass
- return newfunc
- return decorator
-
- start_background_task = staticmethod(start_background_task)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog