-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
35 lines (26 loc) · 960 Bytes
/
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
REMOTE_DBG = False
import sys
# append pydev remote debugger
if REMOTE_DBG:
# Make pydev debugger works for auto reload.
# Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
try:
import pysrc.pydevd as pydevd
# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console
pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
except ImportError:
sys.stderr.write("Error: " +
"You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
sys.exit(1)
import xbmcplugin
import xbmcgui
import viewdb
import xbmcinteg
xbmcinteg.loadDb()
addon_handle = int(sys.argv[1])
xbmcplugin.setContent(addon_handle, 'movies')
l = viewdb.db.getOrderedLastViewedList()
for t in l:
li = xbmcgui.ListItem(t[0], iconImage='DefaultVideo.png')
xbmcplugin.addDirectoryItem(addon_handle, t[1], li)
xbmcplugin.endOfDirectory(addon_handle)