Skip to content

Information on the Universal PyWeather Updater

o355 edited this page May 27, 2018 · 4 revisions

If you're coming here from the new PyWeather Updater, and wondering what all this change is, let me quickly explain a brief history of the notorious PyWeather Updater, and this new UPU (Universal PyWeather Updater).

Beginning with PyWeather 0.3.0 beta, I implemented an updater that would check for updates via an API, and download a .zip file to PyWeather's directory. The user would take care of unzipping those files, and this method of updating continues to work extremely well. Unfortunately, the user still has to do a lot of work themselves to update PyWeather, but it's been reliable.

Beginning with PyWeather 0.5.2 beta, I coded in a Git updater for users on an environment with Git. Unfortunately, this updater failed on most setups for every update up to PyWeather 0.6.3 beta, and I removed the Git updater code in PyWeather 0.6.3 beta. There were numerous issues with bugs, the update process not completing, and the new way the config file was handled beginning with PyWeather 0.6 beta didn't help matters either.

Beginning with PyWeather v1.0.0, a brand new updater will be introduced to build off the legacy of previous PyWeather updaters, and I'm coining it the Universal PyWeather Updater.

The Universal PyWeather Updater (or UPU for short) is a brand new updater in PyWeather that builds off of the foundation of previous .zip updaters.

New features of the UPU over previous update systems include:

  • A fully automated and reliable update system
  • SHA1 and SHA256 hash checks for file integrity
  • 3 methods of updating: The automatic updater, the Git updater, and the classic .zip method
  • A brand new UPU API that provides even more details about updates

Here's how the new UPU will work when coding has started:

  • A user would enter into the updater option, and check for updates.
  • The UPU would contact a new API for the updater, and do usual checks for updates.
  • If a new update is detected, a user prompt would appear asking if the user would like to update PyWeather. If entered yes, the updater begins. The user can define an updater method on a per-update basis, and the steps below indicate the "automatic" option (default).
  • Using the API, a "dirless" .zip of PyWeather is downloaded. The dirless .zip contains all PyWeather files so that they can be extracted from the main directory without having to deal with a "pyweather" folder inside the .zip, which could cause additional issues.
  • The UPU does two hashsum checks on the file.
  • If the hashsum checks match up, the UPU starts unpacking the .zip file, replacing all PyWeather files.
  • The UPU launches configupdate.py, and the user's config is updated, along with installing any new required libraries.
  • After configuration updates occur, the UPU closes down PyWeather, and PyWeather is up to date.
Clone this wiki locally