-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdefault.py
More file actions
58 lines (48 loc) · 1.8 KB
/
Copy pathdefault.py
File metadata and controls
58 lines (48 loc) · 1.8 KB
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
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Philipp Temminghoff (phil65@kodi.tv)
#
# 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
import xbmc
from resources.lib import gui
from kodi65 import addon
class Main:
def __init__(self):
xbmc.log("version %s started" % addon.VERSION)
self._parse_argv()
wnd = gui.get_window(lat=self.params.get("lat"),
lon=self.params.get("lon"),
location=self.params.get("location"),
folder=self.params.get("folder"))
wnd.doModal()
def _parse_argv(self):
self.infos = []
self.params = {}
for arg in sys.argv[1:]:
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 Exception:
pass
if (__name__ == "__main__"):
Main()
xbmc.log('finished')