Provide more extensive commenting

This commit is contained in:
Daniel Johnson 2024-03-18 17:23:44 -04:00
parent b8bf74c006
commit 69fb6f3cdd
2 changed files with 10 additions and 3 deletions

View file

@ -1129,13 +1129,17 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU
we can determine that there are updates to perform."""
def create_runtime_updater():
"""WTF"""
"""This function runs on a worker thread and decides what component updates are
required; we do this on a thread because it involves hitting the Lutris.net website,
which can easily block."""
runtime_updater = RuntimeUpdater(force=force_updates)
component_updaters = runtime_updater.create_component_updaters()
return component_updaters, runtime_updater
def create_runtime_updater_cb(result, error):
"""WTF"""
"""Picks up the component updates when we know what they are, and begins the installation.
This must be done on the main thread, since it updates the UI. This would be so much less
ugly with asyncio, but here we are."""
if error:
logger.exception("Failed to obtain updates from Lutris.net: %s", error)
else:

View file

@ -243,7 +243,10 @@ class RuntimeUpdater:
class RuntimeComponentUpdater(ComponentUpdater):
"""A base class for component updates that use the timestamp from a runtime-info dict
to decide when an update is required.
(PS. You are not expected to understand what this docstring means)
These dicts are part of the 'versions.json' file, sent down from the server. They describe
what versions of components are available from the server. This dict includes the modification
date-time of the component, and we compare it to the mtime of the relevant directory.
"""
def __init__(self, remote_runtime_info: Dict[str, Any]) -> None: