core.baselines module

Advanced raw and data folder management, for mods or graphics packs.

core.baselines.find_vanilla(download_missing=True)[source]

Finds the vanilla baseline for the current version.

Starts by unzipping any DF releases in baselines and preprocessing them. If download_missing is set to True, missing baselines will be downloaded.

Returns:

Path to the vanilla folder, eg 'LNP/Baselines/df_40_15', False if baseline not available (and start download), None if version detection is not accurate

core.baselines.find_vanilla_raws(download_missing=True)[source]

Finds vanilla raws for the current version.

core.baselines.prepare_baselines()[source]

Unzip any DF releases found, and discard non-universal files.

core.baselines.remove_empty_dirs(pack, folder)[source]

Removes empty subdirs in a mods or graphics pack.

Parameters:
  • pack – path segments in './LNP/folder/pack/' as strings

  • folder – path segments in './LNP/folder/pack/' as strings

Returns:

int – the number of dirs removed

core.baselines.remove_vanilla_raws_from_pack(pack, folder)[source]

Remove files identical to vanilla raws, return files removed

Parameters:
  • pack – path segments in './LNP/folder/pack/' as strings

  • folder – path segments in './LNP/folder/pack/' as strings

Returns:

int – the number of files removed

core.baselines.set_auto_download(value)[source]

Sets the option for auto-download of baselines.

core.baselines.simplify_pack(pack, folder)[source]

Removes unnecessary files from LNP/<folder>/<pack>.

Parameters:
  • pack – path segments in './LNP/folder/pack/' as strings

  • folder – path segments in './LNP/folder/pack/' as strings

Returns:

The number of files removed if successful, False if an exception occurred, None if folder is empty