Replace depricated xbmc.abortRequested

This commit is contained in:
croneter 2020-05-05 18:18:34 +02:00
parent d9d89f3e6c
commit 92a28b6eda
5 changed files with 10 additions and 11 deletions

View file

@ -134,7 +134,7 @@ class App(object):
thread.suspend(block=True) thread.suspend(block=True)
else: else:
break break
return xbmc.abortRequested return xbmc.Monitor().abortRequested()
def resume_threads(self): def resume_threads(self):
""" """
@ -144,7 +144,7 @@ class App(object):
LOG.debug('Resuming threads: %s', self.threads) LOG.debug('Resuming threads: %s', self.threads)
for thread in self.threads: for thread in self.threads:
thread.resume() thread.resume()
return xbmc.abortRequested return xbmc.Monitor().abortRequested()
def stop_threads(self, block=True): def stop_threads(self, block=True):
""" """

View file

@ -305,7 +305,7 @@ class Task(object):
self._canceled = True self._canceled = True
def should_cancel(self): def should_cancel(self):
return self._canceled or xbmc.abortRequested return self._canceled or xbmc.Monitor().abortRequested()
def isValid(self): def isValid(self):
return not self.finished and not self._canceled return not self.finished and not self._canceled
@ -370,7 +370,7 @@ class BackgroundWorker(object):
return self return self
def aborted(self): def aborted(self):
return self._abort or xbmc.abortRequested return self._abort or xbmc.Monitor().abortRequested()
def start(self): def start(self):
if self._thread and self._thread.isAlive(): if self._thread and self._thread.isAlive():
@ -452,7 +452,7 @@ class BackgroundThreader:
return self return self
def aborted(self): def aborted(self):
return self._abort or xbmc.abortRequested return self._abort or xbmc.Monitor().abortRequested()
def shutdown(self, block=True): def shutdown(self, block=True):
self.abort() self.abort()

View file

@ -66,8 +66,7 @@ def _wait_for_auth():
xbmcplugin.endOfDirectory(int(argv[1]), False) if failed xbmcplugin.endOfDirectory(int(argv[1]), False) if failed
WARNING - this will potentially stall the shutdown of Kodi since we cannot WARNING - this will potentially stall the shutdown of Kodi since we cannot
poll xbmc.Monitor().abortRequested() or waitForAbort() or poll xbmc.Monitor().abortRequested() or waitForAbort()
xbmc.abortRequested
""" """
counter = 0 counter = 0
startupdelay = int(utils.settings('startupDelay') or 0) startupdelay = int(utils.settings('startupDelay') or 0)

View file

@ -102,7 +102,7 @@ class Service(object):
@staticmethod @staticmethod
def should_cancel(): def should_cancel():
return xbmc.abortRequested or app.APP.stop_pkc return xbmc.Monitor().abortRequested() or app.APP.stop_pkc
def on_connection_check(self, result): def on_connection_check(self, result):
""" """

View file

@ -737,7 +737,7 @@ class MultiWindow(object):
return mw return mw
def _open(self): def _open(self):
while not xbmc.abortRequested and not self._allClosed: while not xbmc.Monitor().abortRequested() and not self._allClosed:
self._setupCurrent(self._next) self._setupCurrent(self._next)
self._current.modal() self._current.modal()
@ -922,9 +922,9 @@ class PropertyTimer():
self._callback() self._callback()
def _wait(self): def _wait(self):
while not xbmc.abortRequested and time.time() < self._endTime: while not xbmc.Monitor().abortRequested() and time.time() < self._endTime:
app.APP.monitor.waitForAbort(0.1) app.APP.monitor.waitForAbort(0.1)
if xbmc.abortRequested: if xbmc.Monitor().abortRequested():
return return
if self._endTime == 0: if self._endTime == 0:
return return