forked from phil65/script.maps.browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.py
More file actions
57 lines (50 loc) · 1.86 KB
/
Copy pathdefault.py
File metadata and controls
57 lines (50 loc) · 1.86 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
#!/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/>.
#
import sys
import xbmc
import xbmcaddon
from resources.lib import gui
ADDON = xbmcaddon.Addon()
ADDON_VERSION = ADDON.getAddonInfo('version')
ADDON_NAME = ADDON.getAddonInfo('name')
ADDON_PATH = ADDON.getAddonInfo('path').decode("utf-8")
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:
pass
if (__name__ == "__main__"):
Main()
xbmc.log('finished')