-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrouter.py
35 lines (24 loc) · 811 Bytes
/
router.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
# -*- coding: utf-8 -*-
'''
ERTflix Addon
Author Twilight0
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
'''
from __future__ import absolute_import
import sys
from tulip.compat import parse_qsl
from tulip.control import infoLabel
from tulip.url_dispatcher import urldispatcher
# noinspection PyProtectedMember, PyUnresolvedReferences
from resources.lib import navigator, utils
def main(argv=None):
if sys.argv: argv = sys.argv
params = dict(parse_qsl(argv[2][1:]))
action = params.get('action', 'root')
if 'audio' in infoLabel('Container.FolderPath') and action in [None, 'root']:
action = 'radios'
urldispatcher.dispatch(action, params)
if __name__ == '__main__':
utils.keys_registration()
sys.exit(main())