Does this mean that xbmc.sleep() should never be used in an addon or just form 
that's shown in the previous email?

I've been using it to get around a subtitle issue in pre-Helix versions of 
Kodi, where a bit of delay is needed.

Thanks

Sent from my iPhone

On Oct 30, 2015, at 11:33 AM, Martijn Kaijser <mart...@xbmc.org> wrote:

> 
> We just want to bring to attention, that xbmc.sleep is hurting Kodi right 
> now, when a user tires to shut down.
> It would be really appreciated if each of you can have a look and make sure 
> your addon/s are not using it any more.
> 
> The bad code we're looking for looks like this:
> 
>     import time
>     import xbmc
>      
>     if __name__ == '__main__':
>         while not xbmc.abortRequested:
>             # some code
>             xbmc.log("hello addon! %s" % time.time(), level=xbmc.LOGDEBUG)
>             xbmc.sleep(500)
>             
> 
> the way you should do it is this:
> 
>     import time
>     import xbmc
>      
>     if __name__ == '__main__':
>         monitor = xbmc.Monitor()
>      
>         while not monitor.abortRequested():
>             # Sleep/wait for abort for 10 seconds
>             if monitor.waitForAbort(10):
>                 # Abort was requested while waiting. We should exit
>                 break
>             xbmc.log("hello addon! %s" % time.time(), level=xbmc.LOGDEBUG)
>             
> You can find more documentation here:
> http://kodi.wiki/view/Service_add-ons
> 
> If you have any questions, please let us know.
> 
> Cheers,
> Razzeee / Team Kodi
> (this e-mail was send on behalf of Razzeee)
> ------------------------------------------------------------------------------
> _______________________________________________
> Xbmc-addons mailing list
> Xbmc-addons@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xbmc-addons
------------------------------------------------------------------------------
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to