forked from patrick-klein/script.library.integration.tool
-
Notifications
You must be signed in to change notification settings - Fork 5
/
service.py
36 lines (26 loc) · 927 Bytes
/
service.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# # -*- coding: utf-8 -*-
"""A service entrypoint."""
import logging
import sys
import time
from os.path import basename
import xbmc
from resources.lib import logger
from resources.lib.gui.gui_utils import notification
from resources.lib.menus.main import MainMenu
from resources.lib.test.tests import run_tests
LOG = logging.getLogger(basename(__file__))
class LitWatcher(xbmc.Monitor):
"""Service class."""
# https://github.com/romanvm/kodi.web-pdb
# https://forum.kodi.tv/showthread.php?tid=248758
def __init__(self) -> None:
super().__init__()
while not self.abortRequested():
# Sleep/wait for abort for 20 seconds
if self.waitForAbort(20):
# Abort was requested while waiting. We should exit
break
notification("hello addon! xxxx")
if __name__ == "__main__":
LitWatcher()