def create_updater(self, just_checking=False): """Create a new autoupdater instance.""" self.autoupdate = AutoUpdate(BUILD, self, just_checking=just_checking) self.autoupdate.start()
import argparse import os from autoupdate import AutoUpdate from version import BUILD parser = argparse.ArgumentParser() parser.add_argument( "-z", "--zip", action="store_true", help="Update from a build.zip file instead of downloading the update") args = parser.parse_args() autoupdate = AutoUpdate(BUILD, None) if args.zip: archive = "updating/build.zip" if not os.path.exists(archive): print(f"The archived build {archive!r} couldn't be found.") else: autoupdate.path_archive = archive autoupdate.update(stdout=True) else: print("Checking for updates...") build = autoupdate.check() if build is not None: print("A new update is available: {}.\n".format(build)) autoupdate.download(stdout=True) autoupdate.update(stdout=True) else: