Dirk Meyer wrote:
> Duncan Webb wrote:
>> Author: duncan
>> Date: Tue Mar 31 12:06:58 2009
>> New Revision: 11375
>>
>> Log:
>> Traceback on shutdown from kaa
>> Fix applied, actually this does not fix the bug but stops the stack trace
>
> I wanted to fix that, too, but I wondered about the code:
>
>> Modified: branches/rel-1/freevo/src/tv/plugins/livepause/backend.py
>> ==============================================================================
>> --- branches/rel-1/freevo/src/tv/plugins/livepause/backend.py
>> (original)
>> +++ branches/rel-1/freevo/src/tv/plugins/livepause/backend.py Tue Mar
>> 31 12:06:58 2009
>> @@ -191,7 +191,7 @@
>> if inprogress is None:
>> return False
>> inprogress.wait()
>> - result = inprogress.get_result()
>> + result = inprogress.result
>> return result
>
> replace the last four lines with
> | return inprogress.wait()
Nice.
>> Modified: branches/rel-1/freevo/src/tv/record_client.py
>> ==============================================================================
>> --- branches/rel-1/freevo/src/tv/record_client.py (original)
>> +++ branches/rel-1/freevo/src/tv/record_client.py Tue Mar 31 12:06:58 2009
>> @@ -103,7 +103,7 @@
>> print self.timeit(now)+': pingCo.inprogress=%r' % inprogress
>> yield inprogress
>> print self.timeit(now)+': pingCo.inprogress=%r' % inprogress
>> - yield inprogress.get_result()
>> + yield inprogress.result
>> print self.timeit(now)+': pingCo finished' # we never get here
>
> Do you ever see the 'print'? I guess yield inprogress.result will just
> return the result and stop the coroutine. The same is true for other
> parts of the patch.
Changing "yield inprogress.result" to "result = inprogress.result" does
the trick, so now this is shown:
./freevo --execute=src/tv/record_client.py pingco
function='pingco' args=[]
0.000: pingCo started
0.003: pingCo.inprogress=<kaa.async.InProgress object at 0xb68bf74c>
0.013: pingCo.inprogress=<kaa.async.InProgress object at 0xb68bf74c>
0.015: pingCo finished=True
0.019: pingCo=None
This not quite correct as I would like the result of the pingCo to be
obtained. How do we do this now?
>> @@ -179,12 +179,12 @@
>> if not inprogress:
>> return
>> yield inprogress
>> - yield inprogress.get_result()
>> + yield inprogress.result
>> inprogress = self._recordserver_rpc('findNextProgram')
>> if not inprogress:
>> return
>> yield inprogress
>> - nextstart = inprogress.get_result()
>> + nextstart = inprogress.result
>
> And this looks wrong. Like above, yield inprogress.result should stop
> the coroutine. The findNextProgram should never be called.
This is correct findNextProgram is not called. What is the correct way
to call this; Doing the same as with pingWait does work but may not be
the best method?
>> def pingNow(self):
>> @@ -194,7 +194,7 @@
>> if inprogress is None:
>> return False
>> inprogress.wait()
>> - result = inprogress.get_result()
>> + result = inprogress.result
>> _debug_('pingNow.result=%r' % (result,), 2)
>> return result
>
> Like the first case: return inprogress.wait(). The same is true for the
> next functions.
This one does write the debug message to the log, changing this to a
print shows:
# ./freevo --execute=src/tv/record_client.py pingnow
function='pingnow' args=[]
pingNow.result=True
0.014: result=True
Thanks for this
Duncan
------------------------------------------------------------------------------
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel