-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaddonsync.py
50 lines (38 loc) · 1.17 KB
/
addonsync.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8; python-indent-offset: 2; python-guess-indent: nil; -*-
"""Invoke AddonSync as a Kodi Program add-on.
This file is part of service.addonsync.
SPDX-FileCopyrightText: © 2016 Rob Webset
SPDX-FileCopyrightText: 2020-2021 Peter J. Mello <admin@petermello.net>
SPDX-License-Identifier: MPL-2.0
See LICENSES/MPL-2.0.txt for more information.
"""
from __future__ import annotations, generator_stop
import xbmcgui
from xbmcaddon import Addon
from .core import AddonSync
from .settings import log
ADDON = Addon(id="service.addonsync")
ICON = ADDON.getAddonInfo("icon")
ADDONSYNC = AddonSync()
if __name__ == "__main__":
log("AddonSync: Started Manually")
# Print message that we have started
xbmcgui.Dialog().notification(
ADDON.getLocalizedString(32001),
ADDON.getLocalizedString(32019),
ICON,
3000,
False
)
COMPLETED = ADDONSYNC.start_sync()
# Only show the complete message if we have not shown an error
if COMPLETED:
xbmcgui.Dialog().notification(
ADDON.getLocalizedString(32001),
ADDON.getLocalizedString(32020),
ICON,
3000,
False,
)
del ADDONSYNC
log("AddonSync: End Manual Running")