Author: dmeyer
Date: Sun Jan 20 05:01:56 2008
New Revision: 2987
Log:
InProgress.is_finished is now a function
Modified:
trunk/base/src/notifier/async.py
trunk/base/src/notifier/thread.py
trunk/base/src/notifier/yieldfunc.py
trunk/epg/src/__init__.py
Modified: trunk/base/src/notifier/async.py
==============================================================================
--- trunk/base/src/notifier/async.py (original)
+++ trunk/base/src/notifier/async.py Sun Jan 20 05:01:56 2008
@@ -102,7 +102,7 @@
"""
Signal.__init__(self)
self.exception = Signal()
- self.is_finished = False
+ self._finished = False
self.status = None
@@ -123,7 +123,7 @@
"""
if self.status is not None:
return self.status
- return not self.is_finished
+ return not self._finished
def finished(self, result):
@@ -137,7 +137,7 @@
result.exception.connect(self.throw)
return
# store result
- self.is_finished = True
+ self._finished = True
self._result = result
self._exception = None
# emit signal
@@ -162,7 +162,7 @@
log.error('*** InProgress exception not handled ***\n%s', trace)
# store result
- self.is_finished = True
+ self._finished = True
self._exception = e
# emit signal
self.exception.emit_when_handled(e)
@@ -177,17 +177,24 @@
The function will either return the result or raise the exception
provided to the exception function.
"""
- # DEPRECATED!!!!!!!
+ log.warning('Deprecated call to InProgress(); use get_result()
instead')
return self.get_result()
+ def is_finished(self):
+ """
+ Return if the InProgress is finished.
+ """
+ return self._finished
+
+
def get_result(self):
"""
Get the results when finished.
The function will either return the result or raise the exception
provided to the exception function.
"""
- if not self.is_finished:
+ if not self._finished:
raise RuntimeError('operation not finished')
if self._exception:
raise self._exception
Modified: trunk/base/src/notifier/thread.py
==============================================================================
--- trunk/base/src/notifier/thread.py (original)
+++ trunk/base/src/notifier/thread.py Sun Jan 20 05:01:56 2008
@@ -80,7 +80,7 @@
def _set_result(self, result):
self._sync_return = result
if isinstance(self._sync_return, InProgress):
- if not self._sync_return.is_finished:
+ if not self._sync_return.is_finished():
self._sync_return.connect_both(self._set_result,
self._set_exception)
return
self._sync_return = self._sync_return()
Modified: trunk/base/src/notifier/yieldfunc.py
==============================================================================
--- trunk/base/src/notifier/yieldfunc.py (original)
+++ trunk/base/src/notifier/yieldfunc.py Sun Jan 20 05:01:56 2008
@@ -169,7 +169,7 @@
# XXX to always return an InProgress object.
return result
function = result
- if lock and func._lock is not None and not func._lock.is_finished:
+ if lock and func._lock is not None and not
func._lock.is_finished():
# Function is currently called by someone else
return YieldLock(func, function, interval)
async = None
@@ -184,7 +184,7 @@
# XXX to always return an InProgress object.
return None
if isinstance(result, InProgress):
- if result.is_finished:
+ if result.is_finished():
# InProgress return that is already finished, go on
async = result
continue
@@ -278,7 +278,7 @@
try:
while True:
result = _process(self._yield__function, self._async)
- if isinstance(result, InProgress) and result.is_finished:
+ if isinstance(result, InProgress) and result.is_finished():
# the result is a finished InProgress object
self._async = result
continue
@@ -344,7 +344,7 @@
"""
Try to start now.
"""
- if not self._func._lock.is_finished:
+ if not self._func._lock.is_finished():
# still locked by a new call, wait again
self._func._lock.connect_both(self._try_again, self._try_again)
return
Modified: trunk/epg/src/__init__.py
==============================================================================
--- trunk/epg/src/__init__.py (original)
+++ trunk/epg/src/__init__.py Sun Jan 20 05:01:56 2008
@@ -94,7 +94,7 @@
if block:
wait = guide.search(channel, time, **kwargs)
- while not wait.is_finished:
+ while not wait.is_finished():
kaa.main.step()
return wait()
return guide.search(channel, time, **kwargs)
-------------------------------------------------------------------------
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