forked from Steveb1968/script.pseudotv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
59 lines (52 loc) · 2.16 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright (C) 2011 Jason Anderson
#
#
# This file is part of PseudoTV.
#
# PseudoTV is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PseudoTV is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PseudoTV. If not, see <http://www.gnu.org/licenses/>.
import xbmc, xbmcgui, xbmcaddon
import sys
import os
# Script constants
ADDON = xbmcaddon.Addon(id='script.pseudotv')
CWD = ADDON.getAddonInfo('path').decode("utf-8")
RESOURCE = xbmc.translatePath(os.path.join(CWD, 'resources', 'lib').encode("utf-8")).decode("utf-8")
sys.path.append(RESOURCE)
SkinID = xbmc.getSkinDir()
if SkinID != 'skin.estuary':
import MyFont
if MyFont.getSkinRes() == '1080i':
MyFont.addFont("PseudoTv10", "Lato-Regular.ttf", "24")
MyFont.addFont("PseudoTv12", "Lato-Regular.ttf", "25")
MyFont.addFont("PseudoTv13", "Lato-Regular.ttf", "30")
MyFont.addFont("PseudoTv14", "Lato-Regular.ttf", "33")
else:
MyFont.addFont("PseudoTv10", "Lato-Regular.ttf", "14")
MyFont.addFont("PseudoTv12", "Lato-Regular.ttf", "16")
MyFont.addFont("PseudoTv13", "Lato-Regular.ttf", "20")
MyFont.addFont("PseudoTv14", "Lato-Regular.ttf", "22")
def Start():
if xbmc.Player().isPlaying():
xbmc.Player().stop()
import Overlay as Overlay
MyOverlayWindow = Overlay.TVOverlay("script.pseudotv.TVOverlay.xml", CWD, "default")
del MyOverlayWindow
xbmcgui.Window(10000).setProperty("PseudoTVRunning", '')
if xbmcgui.Window(10000).getProperty("PseudoTVRunning") != "True":
xbmcgui.Window(10000).setProperty("PseudoTVRunning", "True")
shouldrestart = False
if shouldrestart == False:
Start()
else:
xbmc.log('script.PseudoTV - Already running, exiting', xbmc.LOGERROR)