Author: tack
Date: Fri Feb 15 09:33:33 2008
New Revision: 3104
Log:
Renamed InProgress.finished() to InProgress.finish() so that throw() and
finishe() are both verbs.
Modified:
trunk/base/src/notifier/async.py
trunk/base/src/notifier/coroutine.py
trunk/base/src/notifier/popen.py
trunk/base/src/notifier/thread.py
trunk/base/src/rpc.py
Modified: trunk/base/src/notifier/async.py
==============================================================================
--- trunk/base/src/notifier/async.py (original)
+++ trunk/base/src/notifier/async.py Fri Feb 15 09:33:33 2008
@@ -136,6 +136,12 @@
def finished(self, result):
+ # XXX: Temporary wrapper for deprecated method name.
+ log.warning('InProgress.finished() deprecated; use
InProgress.finish()')
+ return self.finish(result)
+
+
+ def finish(self, result):
"""
This function should be called when the creating function is
done and no longer in progress.
@@ -258,7 +264,7 @@
except:
self.throw(*sys.exc_info())
else:
- self.finished(result)
+ self.finish(result)
return self
@@ -333,7 +339,7 @@
Links with another InProgress object. When the supplied in_progress
object finishes (or throws), we do too.
"""
- in_progress.connect_both(self.finished, self.throw)
+ in_progress.connect_both(self.finish, self.throw)
def _connect(self, callback, args = (), kwargs = {}, once = False,
@@ -378,17 +384,17 @@
# try to get the results as the caller excepts them
if args and kwargs:
# no idea how to merge them
- return self.finished((args, kwargs))
+ return self.finish((args, kwargs))
if kwargs and len(kwargs) == 1:
# return the value
- return self.finished(kwargs.values()[0])
+ return self.finish(kwargs.values()[0])
if kwargs:
# return as dict
- return self.finished(kwargs)
+ return self.finish(kwargs)
if len(args) == 1:
# return value
- return self.finished(args[0])
+ return self.finish(args[0])
if len(args) > 1:
# return as list
- return self.finished(args)
- return self.finished(None)
+ return self.finish(args)
+ return self.finish(None)
Modified: trunk/base/src/notifier/coroutine.py
==============================================================================
--- trunk/base/src/notifier/coroutine.py (original)
+++ trunk/base/src/notifier/coroutine.py Fri Feb 15 09:33:33 2008
@@ -132,7 +132,7 @@
elif result != NotFinished:
# everything went fine, return result in an InProgress
ip = InProgress()
- ip.finished(result)
+ ip.finish(result)
return ip
# we need a CoroutineInProgress to finish this later
# result is either NotFinished or InProgress
@@ -215,7 +215,7 @@
self.throw(*sys.exc_info())
return False
self.stop()
- self.finished(result)
+ self.finish(result)
return False
Modified: trunk/base/src/notifier/popen.py
==============================================================================
--- trunk/base/src/notifier/popen.py (original)
+++ trunk/base/src/notifier/popen.py Fri Feb 15 09:33:33 2008
@@ -390,7 +390,7 @@
self.child = None
if self.__kill_timer:
notifier.timer_remove( self.__kill_timer )
- self.in_progress.finished(status >> 8)
+ self.in_progress.finish(status >> 8)
self.in_progress = None
self.signals['completed'].emit(status >> 8)
Modified: trunk/base/src/notifier/thread.py
==============================================================================
--- trunk/base/src/notifier/thread.py (original)
+++ trunk/base/src/notifier/thread.py Fri Feb 15 09:33:33 2008
@@ -228,7 +228,7 @@
_thread_notifier_lock.release()
try:
- in_progress.finished(callback(*args, **kwargs))
+ in_progress.finish(callback(*args, **kwargs))
except:
in_progress.throw(*sys.exc_info())
@@ -248,7 +248,7 @@
except:
in_progress.throw(*sys.exc_info())
else:
- in_progress.finished(result)
+ in_progress.finish(result)
return in_progress
@@ -282,7 +282,7 @@
# Looks like the callback is yielding something, or callback
is a
# coroutine-decorated function. Not supported (yet?).
log.warning('NYI: threads cannot yet be coroutines.')
- MainThreadCallback(self.finished)(result)
+ MainThreadCallback(self.finish)(result)
self._callback = None
Modified: trunk/base/src/rpc.py
==============================================================================
--- trunk/base/src/rpc.py (original)
+++ trunk/base/src/rpc.py Fri Feb 15 09:33:33 2008
@@ -543,7 +543,7 @@
if callback is None:
return True
del self._rpc_in_progress[seq]
- callback.finished(payload)
+ callback.finish(payload)
return True
if type == 'EXCP':
-------------------------------------------------------------------------
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