def select_build(self): build_select = gui.BuildSelectDialog(self.installed_build) build_select.doModal() self.selected_source = build_select.selected_source addon.set_setting('source_name', self.selected_source) log.log("Selected source: " + str(self.selected_source)) if not build_select: log.log("No build selected") sys.exit(0) selected_build = build_select.selected_build log.log("Selected build: " + str(selected_build)) build_str = utils.format_build(selected_build) msg = L10n(32003).format(utils.format_build(self.installed_build), build_str) if selected_build < self.installed_build: args = (L10n(32004), L10n(32005), msg) elif selected_build > self.installed_build: args = (L10n(32001), L10n(32002), msg) else: msg = L10n(32007).format(build_str) args = (L10n(32006), msg, L10n(32008)) if not utils.yesno(*args): sys.exit(0) self.selected_build = selected_build
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)
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)
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))