core.update module

Provides functions to update Source.Python and its data files.

core.update.download_file(url_path, file_path, timeout=3)[source]

Download a file from an URL to a specific file.

Parameters:
  • url_path (str) – The URL that should be opened.
  • file_path (str) – The file where the content of the URL should be stored.
  • timeout (float) – Number of seconds that need to pass until a timeout occurs.
core.update.get_build_artifacts(timeout=3)[source]

Return the artifacts of the latest Source.Python build.

Parameters:timeout (float) – Number of seconds that need to pass until a timeout occurs.
core.update.get_download_url(game='css', timeout=3)[source]

Get the latest Source.Python download URL for a specific game.

Parameters:
  • game (str) – The game game to look for (e.g. css).
  • timeout (float) – Number of seconds that need to pass until a timeout occurs.
Return type:

str

Raises:

ValueError – Raised if the game wasn’t found.

core.update.get_latest_data_checksum(timeout=3)[source]

Return the MD5 checksum of the latest data from the build server.

Parameters:timeout (float) – Number of seconds that need to pass until a timeout occurs.
Return type:str
core.update.is_new_data_available(timeout=3)[source]

Return True if new data is available.

Parameters:timeout (float) – Number of seconds that need to pass until a timeout occurs.
Return type:bool
core.update.update_data(timeout=3)[source]

Download and unpack the latest data from the build server.

Old data gets deleted before unpacking.

Parameters:timeout (float) – Number of seconds that need to pass until a timeout occurs.