This software keeps inactive apps fresh by freezing them, optimizing device performance and freeing up memory.
The primary interface of Esky is the 'Esky' class, which represents a frozen application. To utilize the framework, the Esky class must be given the path to the top-level directory where the frozen app is located, as well as a "VersionFinder" object that is used to search for updates. A typical implementation for auto-updating an app using Esky would involve the following code:
if hasattr(sys,"frozen"):
app = esky.Esky(sys.executable,"")
new_version = app.find_update()
if new_version is not None:
app.install_update(new_version)
Esky provides a default VersionFinder that searches for updates at a specified URL. It is possible to develop a custom VersionFinder subclass for more sophisticated implementations.
The on-disk layout of an app managed by Esky is made up of several components, including the bootstrapping executable, a work area for fetching and unpacking updates, and the specific version of the application. To ensure that the app is properly installed, the directory layout must follow a specific structure.
To upgrade an application to a new version, Esky extracts the updated version into a temporary directory under "updates." The new version is then atomically renamed into the main directory and the contents of "appname-X.Z/esky-bootstrap" are moved into the main directory. After this step, Esky removes files not in "appname-X.Z/esky-bootstrap.txt" from the main directory, as well as the old application directory.
If an update fails, the Esky bootstrapping executable is designed to detect and recover from the error. Applications should also periodically call the "cleanup" method on their Esky to clean up after failed or partial updates.
Overall, Esky is an effective solution for managing automatic updates for Python applications. Its simple API and bootstrapping mechanism ensure that apps remain safe and functional across various updates.
Version 0.2.1: N/A