def sleep(sleep_time): while not xbmc.abortRequested and sleep_time > 0: sleep_time -= 100 xbmc.sleep(99)