-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdefault.py
29 lines (25 loc) · 1.03 KB
/
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
import os, sys
import xbmc, xbmcaddon
__addon__ = xbmcaddon.Addon()
__addonid__ = __addon__.getAddonInfo('id')
__addonversion__ = __addon__.getAddonInfo('version')
__language__ = __addon__.getLocalizedString
__cwd__ = __addon__.getAddonInfo('path').decode("utf-8")
__resource__ = xbmc.translatePath( os.path.join( __cwd__, 'resources', 'lib' ).encode("utf-8") ).decode("utf-8")
sys.path.append(__resource__)
if ( __name__ == "__main__" ):
searchstring = None
try:
params = dict( arg.split( "=" ) for arg in sys.argv[ 1 ].split( "&" ) )
searchstring = params.get("searchstring")
searchstring = urllib.unquote_plus(searchstring)
except:
keyboard = xbmc.Keyboard( '', __language__(32101), False )
keyboard.doModal()
if ( keyboard.isConfirmed() ):
searchstring = keyboard.getText()
if searchstring:
import gui
ui = gui.GUI( "script-globalsearch-main.xml", __cwd__, "Default", searchstring=searchstring )
ui.doModal()
del ui