update get_params, remove urlparse dep

This commit is contained in:
Rob Weber 2019-08-27 15:04:30 -05:00
parent 94f872fb81
commit 30f8b93629

View File

@ -1,19 +1,21 @@
import sys
from future.moves.urllib.request import urlparse
from kodi_six import xbmc, xbmcgui
import resources.lib.utils as utils
from resources.lib.backup import XbmcBackup
def get_params():
param = {}
if(len(sys.argv) > 1):
try:
for i in sys.argv:
args = i
if(args.startswith('?')):
args = args[1:]
param.update(dict(urlparse.parse_qsl(args)))
if('=' in args):
if(args.startswith('?')):
args = args[1:] #legacy in case of url params
splitString = args.split('=')
param[splitString[0]] = splitString[1]
except:
pass
return param
#the program mode