mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
update get_params, remove urlparse dep
This commit is contained in:
parent
94f872fb81
commit
30f8b93629
16
default.py
16
default.py
@ -1,19 +1,21 @@
|
|||||||
import sys
|
import sys
|
||||||
from future.moves.urllib.request import urlparse
|
|
||||||
from kodi_six import xbmc, xbmcgui
|
from kodi_six import xbmc, xbmcgui
|
||||||
import resources.lib.utils as utils
|
import resources.lib.utils as utils
|
||||||
from resources.lib.backup import XbmcBackup
|
from resources.lib.backup import XbmcBackup
|
||||||
|
|
||||||
def get_params():
|
def get_params():
|
||||||
param = {}
|
param = {}
|
||||||
|
try:
|
||||||
if(len(sys.argv) > 1):
|
|
||||||
for i in sys.argv:
|
for i in sys.argv:
|
||||||
args = i
|
args = i
|
||||||
if(args.startswith('?')):
|
if('=' in args):
|
||||||
args = args[1:]
|
if(args.startswith('?')):
|
||||||
param.update(dict(urlparse.parse_qsl(args)))
|
args = args[1:] #legacy in case of url params
|
||||||
|
splitString = args.split('=')
|
||||||
|
param[splitString[0]] = splitString[1]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return param
|
return param
|
||||||
|
|
||||||
#the program mode
|
#the program mode
|
||||||
|
Loading…
Reference in New Issue
Block a user