-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.py
32 lines (29 loc) · 930 Bytes
/
script.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
import sys
import xbmcgui
from resources.lib import process
from resources.lib.WindowManager import wm
class Main:
def __init__(self):
xbmcgui.Window(10000).setProperty('extendedinfo_running', 'True')
self._parse_argv()
if self.infos:
process.start_info_actions(self.infos, self.params)
else:
xbmcgui.Window(10000).setProperty('infodialogs.active', 'true')
wm.open_video_list()
xbmcgui.Window(10000).clearProperty('infodialogs.active')
xbmcgui.Window(10000).clearProperty('extendedinfo_running')
def _parse_argv(self):
self.infos = []
self.params = {'handle': None}
for arg in sys.argv:
param = arg.replace('"', '').replace("'", ' ')
if param.startswith('info='):
self.infos.append(param[5:])
else:
try:
self.params[param.split('=')[0].lower()] = '='.join(param.split('=')[1:]).strip()
except:
pass
if (__name__ == '__main__'):
Main()