Exemplo n.º 1
0
def new_build_check():
    log.log("Checking for a new build")

    check_official = addon.get_bool_setting('check_official')
    check_interval = addon.get_int_setting('check_interval')

    autoclose_ms = check_interval * 3540000  # check interval in ms - 1 min

    try:
        installed_build = builds.get_installed_build()
    except:
        log.log("Unable to get installed build so exiting")
        sys.exit(1)

    source = addon.get_setting('source_name')
    if (isinstance(installed_build, builds.Release)
            and source == "Official Releases" and not check_official):
        # Don't do the job of the official auto-update system.
        log.log("Skipping build check - official release")
    else:
        builds.arch = utils.get_arch()

        if addon.get_bool_setting('set_timeout'):
            builds.timeout = float(addon.get_setting('timeout'))

        build_sources = builds.sources()
        try:
            build_url = build_sources[source]
        except KeyError:
            log.log("{} is not a valid source".format(source))
            return

        log.log("Checking {}".format(build_url.url))

        latest = builds.latest_build(source)
        if latest and latest > installed_build:
            if utils.do_show_dialog():
                log.log("New build {} is available, "
                        "prompting to show build list".format(latest))

                if utils.yesno(addon.name,
                               line1=L10n(32027).format(
                                   utils.format_build(latest)),
                               line2=L10n(32028).format(
                                   utils.format_build(installed_build)),
                               line3=L10n(32029),
                               autoclose=autoclose_ms):
                    with Main() as main:
                        main.start()
            else:
                utils.notify(
                    L10n(32030).format(utils.format_build(latest)), 4000)
Exemplo n.º 2
0
def new_build_check():
    log.log("Checking for a new build")
    
    check_official = addon.get_bool_setting('check_official')
    check_interval = addon.get_int_setting('check_interval')

    autoclose_ms = check_interval * 3540000 # check interval in ms - 1 min
    
    try:
        installed_build = builds.get_installed_build()
    except:
        log.log("Unable to get installed build so exiting")
        sys.exit(1)

    source = addon.get_setting('source_name')
    if (isinstance(installed_build, builds.Release) and source == "Official Releases"
        and not check_official):
        # Don't do the job of the official auto-update system.
        log.log("Skipping build check - official release")
    else:
        builds.arch = utils.get_arch()

        if addon.get_bool_setting('set_timeout'):
            builds.timeout = float(addon.get_setting('timeout'))

        build_sources = builds.sources()
        try:
            build_url = build_sources[source]
        except KeyError:
            log.log("{} is not a valid source".format(source))
            return

        log.log("Checking {}".format(build_url.url))

        latest = builds.latest_build(source)
        if latest and latest > installed_build:
            if utils.do_show_dialog():
                log.log("New build {} is available, "
                        "prompting to show build list".format(latest))

                if utils.yesno(
                        addon.name,
                        line1=L10n(32027).format(utils.format_build(latest)),
                        line2=L10n(32028).format(utils.format_build(installed_build)),
                        line3=L10n(32029),
                        autoclose=autoclose_ms):
                    with Main() as main:
                        main.start()
            else:
                utils.notify(L10n(32030).format(utils.format_build(latest)),
                             4000)
Exemplo n.º 3
0
    def confirm(self):
        funcs.create_notify_file(self.selected_source, self.selected_build)

        build_str = utils.format_build(self.selected_build)
        do_notify = False

        if addon.get_bool_setting('confirm_reboot'):
            if utils.yesno(L10n(32022), " ", L10n(32024).format(build_str)):
                xbmc.restart()
            else:
                do_notify = True
        else:
            if progress.reboot_countdown(
                    L10n(32054), L10n(32025).format(build_str),
                    addon.get_int_setting('reboot_count')):
                xbmc.restart()
                sys.exit()
            else:
                do_notify = True

        if do_notify:
            utils.notify(L10n(32026).format(build_str))
Exemplo n.º 4
0
    def confirm(self):
        funcs.create_notify_file(self.selected_source, self.selected_build)

        build_str = utils.format_build(self.selected_build)
        do_notify = False

        if addon.get_bool_setting('confirm_reboot'):
            if utils.yesno(L10n(32022), " ", L10n(32024).format(build_str)):
                xbmc.restart()
            else:
                do_notify = True
        else:
            if progress.reboot_countdown(
                    L10n(32054),
                    L10n(32025).format(build_str),
                    addon.get_int_setting('reboot_count')):
                xbmc.restart()
                sys.exit()
            else:
                do_notify = True

        if do_notify:
            utils.notify(L10n(32026).format(build_str))