This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
/
gui.py
61 lines (56 loc) · 1.63 KB
/
gui.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
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
59
60
61
import sys
import os
import re
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import utils
params = utils.parameters_string_to_dict(sys.argv[2])
mode = params.get('mode', '')
#now this is ugly, but the best possible
def main(mode):
if mode == 'game':
import launchGame
launchGame.launchGame(params)
elif mode == 'games':
import listGames
listGames.listGames(params)
elif mode == 'clients':
import listClients
listClients.listClients(params)
elif mode == 'noauth':
import listClients
listClients.no_authentification(params)
elif mode == 'achievements':
import listAchievements
listAchievements.listAchievements(params)
elif mode == 'movies':
import listMovies
listMovies.listMovies(params)
elif mode == 'wakeIndex':
import wakeIndex
wakeIndex.wakeIndex()
elif mode == 'wake':
import wake
wake.wake(params)
elif mode == 'clearMacs':
try:
import cPickle as pickle
except:
import pickle
pickle.dump(set(), open(os.path.join(utils.USER_DATA, "macs.pickle"), "w+"))
elif mode == 'reset':
main("clearMacs")
utils.addon.setSetting("invalid_steam_api_key", "false")
utils.addon.setSetting("steam_api_key", "")
utils.addon.setSetting("prescript", "")
utils.addon.setSetting("postscript", "")
utils.addon.setSetting("first_run", "true")
elif mode == 'settings':
utils.addon.openSettings()
else:
import index
index.index()
if __name__ == '__main__':
main(mode)