forked from Phhere/plugin.video.xstream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.py
37 lines (32 loc) · 1.13 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
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from os import getcwd
from os.path import join
from sys import path
import xbmc
from xbmc import log
from resources.lib import common
__settings__ = common.addon
__cwd__ = common.addonPath
# Add different library path
path.append(join(__cwd__, "resources", "lib"))
path.append(join(__cwd__, "resources", "lib", "gui"))
path.append(join(__cwd__, "resources", "lib", "handler"))
path.append(join(__cwd__, "resources", "art", "sites"))
path.append(join(__cwd__, "sites"))
log("The new sys.path list: %s" % path, level = xbmc.LOGDEBUG)
# Run xstream
from xstream import run
log('*---- Running xStream, version %s ----*' % __settings__.getAddonInfo('version'))
#import cProfile
#cProfile.run('run()',join(__cwd__,'xstream.pstats'))
try:
run()
except Exception, err:
if str(err) == 'UserAborted':
print "\t[xStream] User aborted list creation"
else:
import traceback
import xbmcgui
print traceback.format_exc()
dialog = xbmcgui.Dialog().ok('Error',str(err.__class__.__name__)+" : "+str(err),str(traceback.format_exc().splitlines()[-3].split('addons')[-1]))