-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon.py
130 lines (101 loc) · 3.19 KB
/
addon.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# Copyright (C) 2012 Tommy Winther
# http://tommy.winther.nu
#
# This Program 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 2, or (at your option)
# any later version.
#
# This Program 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 this Program; see the file LICENSE.txt. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
import xbmc
import xbmcaddon
import urllib
import socket
socket.setdefaulttimeout(5) # 5 seconds
import os
import shutil
xbmc.Player().stop
ADDON = xbmcaddon.Addon(id = 'script.tvguidemicro')
HOME = ADDON.getAddonInfo('path')
TITLE = 'DLP TV Guide'
VERSION = '2.0.6'
addon = xbmcaddon.Addon()
addonid = addon.getAddonInfo('id')
versioninfo = addon.getAddonInfo('version')
datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
addonpath = os.path.join(ADDON.getAddonInfo('path'), 'resources')
default_ini = os.path.join(addonpath, 'addons.ini')
local_ini = os.path.join(addonpath, 'local.ini')
current_ini = os.path.join(datapath, 'addons.ini')
cats = ADDON.getSetting('categories')
oss = 'OffSide Streams'
stvb = 'StreamTVBox'
print '****** DLP TV GUIDE INFORMATION ******'
print addonid, versioninfo
def CheckVersion():
prev = ADDON.getSetting('VERSION')
curr = VERSION
if prev == curr:
return
if prev == '2.0.5':
d = xbmcgui.Dialog()
d.ok(TITLE + ' - ' + VERSION, 'Para mas Informacion y soporte Aqui' , '[COLOR FF00FF00] http://proyectoluzdigital@proyectoluzdigital.com/[/COLOR] para un mejor mantenimiento del foro','Por favor pinchen en el FLOTADOR del foro Gracias')
ADDON.setSetting('VERSION', curr)
if oss or stvb in cats:
cats = cats.replace(oss, '').replace(stvb, '')
while '||' in cats:
cats = cats.replace('||', '|')
ADDON.setSetting('categories', cats)
if not os.path.exists(current_ini):
try: os.makedirs(datapath)
except: pass
shutil.copy(default_ini, datapath)
shutil.copy(local_ini, datapath)
ooOOOoo = ''
def ttTTtt(i, t1, t2=[]):
t = ooOOOoo
for c in t1:
t += chr(c)
i += 1
if i > 1:
t = t[:-1]
i = 0
for c in t2:
t += chr(c)
i += 1
if i > 1:
t = t[:-1]
i = 0
return t
path = current_ini
busy = None
try:
import xbmcgui
busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
busy.show()
try: busy.getControl(10).setVisible(False)
except: pass
except:
busy = None
import buggalo
import gui
buggalo.GMAIL_RECIPIENT = 'http://proyectoluzdigital@proyectoluzdigital.com/'
try:
CheckVersion()
w = gui.TVGuide()
if busy:
busy.close()
busy = None
w.doModal()
del w
except Exception:
buggalo.onExceptionRaised()