On Sun, 2008-02-17 at 12:35 +0100, Duncan Webb wrote:
> kaa.notifier.async.AsyncException: Exception raised asynchronously; 
> traceback follows:
>    File "../base/build/lib.linux-i686-2.4/kaa/notifier/coroutine.py", 
> line 203, in _step
>    File "/usr/lib/python2.4/site-packages/freevo/tv/epg_types.py", line 
> 121, in __cmp__
>      return self.title != other.title or \
> AttributeError: 'object' object has no attribute 'title'
> 
> 
> Now I see where the error comes from but not why the __cmp__() is being 
> called.

The coroutine wrapper must check the result of the coroutine to see if
it's kaa.NotFinished or not.  If it is, it will schedule the coroutine
(or rather its underlying generator) to be called again.  If not, it
finishes the InProgress it returned with the value.

Here is the relevant code from coroutine.py:

                result = _process(self._coroutine, self._async)
                if isinstance(result, InProgress):
                    self._async = result
                    if not result.is_finished():
                        # continue when InProgress is done
                        self._async = result
                        result.connect_both(self._continue, self._continue)
                        return False
                elif result == NotFinished:
                    # schedule next interation with the timer
                    return True
                else:
                    # coroutine is done
                    break

So the result your function is returning is being compared with
kaa.NotFinished, hence the call to __cmp__.

Jason.


-------------------------------------------------------------------------
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-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to