2020-07-19, 12:06
I came across something in the past that i thought worked
on service side to check if kodi request an abort action (e.g. to Kodi close)
you can use example:
then you can stop your looped code.
But if you try to use same code on an add-on instance or script instance
the methods abortRequested, waitForAbort not works at all
I found only the solution to encaplusate the Monitor interface to a python class,
and verify the onNotification events to check when kodi will be terminated:
are there or will there be better solutions?
on service side to check if kodi request an abort action (e.g. to Kodi close)
you can use example:
python:
monitor = xbmc.Monitor()
while not monitor.abortRequested():
if monitor.waitForAbort(1):
break
then you can stop your looped code.
But if you try to use same code on an add-on instance or script instance
the methods abortRequested, waitForAbort not works at all
I found only the solution to encaplusate the Monitor interface to a python class,
and verify the onNotification events to check when kodi will be terminated:
python:
def onNotification(self, sender, method, data):
if method in ['System.OnQuit', 'System.OnRestart', 'System.OnSleep']:
self.is_abort_requested = True
are there or will there be better solutions?