forked from sualfred/script.embuary.helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
43 lines (32 loc) · 997 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
36
37
38
39
40
41
42
43
#!/usr/bin/python
########################
import xbmcgui
from resources.lib.helper import *
from resources.lib.utils import *
from resources.lib.cinema_mode import *
########################
class Main:
def __init__(self):
self.action = False
self._parse_argv()
if self.action:
self.getactions()
else:
DIALOG.ok(ADDON.getLocalizedString(32000), ADDON.getLocalizedString(32001))
def _parse_argv(self):
args = sys.argv
for arg in args:
if arg == ADDON_ID:
continue
if arg.startswith('action='):
self.action = arg[7:].lower()
else:
try:
self.params[arg.split("=")[0].lower()] = "=".join(arg.split("=")[1:]).strip()
except:
self.params = {}
def getactions(self):
util = globals()[self.action]
util(self.params)
if __name__ == '__main__':
Main()