Ejemplo n.º 1
0
def run():
    kodi.set_logger()
    handle_first_run()
    try:
        with DaemonMonitor() as monitor:
            monitor.handle_crashes()
    except DaemonNotFoundError:
        logging.info("Daemon not found. Aborting service...")
        if service_enabled():
            set_service_enabled(False)
            xbmcgui.Dialog().ok(kodi.ADDON_NAME, kodi.translate(30103))
            kodi.open_settings()
Ejemplo n.º 2
0
def main(argv=None):
    if argv is None:
        argv = get_params(sys.argv)
    mode = argv['mode']
    action = argv.get('action', None)
    settings_coord = argv.get('reopen_settings', "").split()

    switch = {
        "main": main_mode,
        "library": library_mode,
        "watch": watch_mode,
    }
    selected_mode = switch[mode]
    try:
        selected_mode(action)
    finally:
        if settings_coord:
            kodi.open_settings(*settings_coord)
Ejemplo n.º 3
0
def handle_first_run():
    logging.info("Handling first run")
    xbmcgui.Dialog().ok(kodi.translate(30100), kodi.translate(30101))
    kodi.open_settings()
Ejemplo n.º 4
0
def start():
    kodi.open_settings(category=2, action=1)