forked from lollo78/script.pinsentry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.py
31 lines (25 loc) · 1.14 KB
/
default.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
# -*- coding: utf-8 -*-
import xbmcaddon
import xbmc
import xbmcgui
# Import the common settings
from resources.lib.settings import log
ADDON = xbmcaddon.Addon(id='script.pinsentry')
#########################
# Main
#########################
if __name__ == '__main__':
log('script version %s started' % ADDON.getAddonInfo('version'))
# Close any open dialogs
xbmc.executebuiltin("Dialog.Close(all, true)", True)
# Check if PinSentry is running for a restricted user, if that is the case
# when the addon is run as a script we actually just display that users status
if xbmcgui.Window(10000).getProperty("PinSentry_RestrictedUser") not in ["", None]:
xbmcgui.Window(10000).setProperty("PinSentry_DisplayStatus", "true")
else:
# This provides a cut-through so that the PinSentry appears in the program
# area, we could have make the "xbmc.python.pluginsource" extension point
# also provide "executable", but that section does not allow for us to
# put flags in the right hand of the display
log("PinSentry: Running as Addon/Plugin")
xbmc.executebuiltin("RunAddon(script.pinsentry)")