Skip to content

Commit

Permalink
replace sleep with abortRequested and waitForAbort
Browse files Browse the repository at this point in the history
  • Loading branch information
im85288 committed Jun 22, 2020
1 parent c66d015 commit 82c6b72
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resources/lib/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from __future__ import absolute_import, division, unicode_literals
from datetime import datetime, timedelta
from math import ceil
from xbmc import sleep
from xbmc import Monitor
from xbmcgui import WindowXMLDialog
from statichelper import from_unicode
from utils import addon_path, get_setting_bool, localize, localize_time
Expand Down Expand Up @@ -89,10 +89,11 @@ def test_popup(window):
step = 0
wait = 100
timeout = 10000
while popup and step < timeout:
monitor = Monitor()
while popup and step < timeout and not monitor.abortRequested():
if popup.pause:
continue
sleep(wait)
monitor.waitForAbort(wait)
popup.update_progress_control(timeout, wait)
step += wait

Expand Down

0 comments on commit 82c6b72

Please sign in to comment.