From 92a28b6eda63b4ad84f66cae9efc1886ae636bb3 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 5 May 2020 18:18:34 +0200 Subject: [PATCH] Replace depricated xbmc.abortRequested --- resources/lib/app/application.py | 4 ++-- resources/lib/backgroundthread.py | 6 +++--- resources/lib/entrypoint.py | 3 +-- resources/lib/service_entry.py | 2 +- resources/lib/windows/kodigui.py | 6 +++--- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/resources/lib/app/application.py b/resources/lib/app/application.py index 5738913d..a676efbe 100644 --- a/resources/lib/app/application.py +++ b/resources/lib/app/application.py @@ -134,7 +134,7 @@ class App(object): thread.suspend(block=True) else: break - return xbmc.abortRequested + return xbmc.Monitor().abortRequested() def resume_threads(self): """ @@ -144,7 +144,7 @@ class App(object): LOG.debug('Resuming threads: %s', self.threads) for thread in self.threads: thread.resume() - return xbmc.abortRequested + return xbmc.Monitor().abortRequested() def stop_threads(self, block=True): """ diff --git a/resources/lib/backgroundthread.py b/resources/lib/backgroundthread.py index c74fa83e..77a068fe 100644 --- a/resources/lib/backgroundthread.py +++ b/resources/lib/backgroundthread.py @@ -305,7 +305,7 @@ class Task(object): self._canceled = True def should_cancel(self): - return self._canceled or xbmc.abortRequested + return self._canceled or xbmc.Monitor().abortRequested() def isValid(self): return not self.finished and not self._canceled @@ -370,7 +370,7 @@ class BackgroundWorker(object): return self def aborted(self): - return self._abort or xbmc.abortRequested + return self._abort or xbmc.Monitor().abortRequested() def start(self): if self._thread and self._thread.isAlive(): @@ -452,7 +452,7 @@ class BackgroundThreader: return self def aborted(self): - return self._abort or xbmc.abortRequested + return self._abort or xbmc.Monitor().abortRequested() def shutdown(self, block=True): self.abort() diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index ee25c2b1..bdb7a4a2 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -66,8 +66,7 @@ def _wait_for_auth(): xbmcplugin.endOfDirectory(int(argv[1]), False) if failed WARNING - this will potentially stall the shutdown of Kodi since we cannot - poll xbmc.Monitor().abortRequested() or waitForAbort() or - xbmc.abortRequested + poll xbmc.Monitor().abortRequested() or waitForAbort() """ counter = 0 startupdelay = int(utils.settings('startupDelay') or 0) diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index ac65266e..970aa801 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -102,7 +102,7 @@ class Service(object): @staticmethod 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): """ diff --git a/resources/lib/windows/kodigui.py b/resources/lib/windows/kodigui.py index 7dc455ed..ee55335d 100644 --- a/resources/lib/windows/kodigui.py +++ b/resources/lib/windows/kodigui.py @@ -737,7 +737,7 @@ class MultiWindow(object): return mw 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._current.modal() @@ -922,9 +922,9 @@ class PropertyTimer(): self._callback() 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) - if xbmc.abortRequested: + if xbmc.Monitor().abortRequested(): return if self._endTime == 0: return