mod_list¶
- archive_to_string(archive: ZipFile, filepath: str) str¶
Simply grabs a file with the specified name from an archive and returns it as a string. Ensures that the returned string is stripped of special unicode characters that Lupa dislikes.
- discover_mods( ) dict[str, list[Mod]]¶
Returns an list of all mods detected at a specific game data and mod folder location, including different versions of the same mod. If there are multiples of the same mod found, the mods are sorted latest version first, preferring folders if there’s a tie.
- display_mods( ) None¶
Pretty-print a given list of mods, primarily for command line interface purposes.
- file_to_string(filepath: str) str¶
Simply grabs a file’s contents and returns it as a string. Ensures that the returned string is stripped of special unicode characters that Lupa dislikes.
-
register_mod(mod_name, mod_location, mod_list_json=
{'mods': {}})¶ Attempts to create a
Modobject from the given folder or zip file. This function not only touches the archive or folder pointed to, but also determines whether or not it’s enabled from themod_list_jsonparameter (if present).
- set_mods_enabled( )¶
Sets a given list of mod names to be either enabled or disabled, based on parameter
enabled.
- class Mod(
- location: str,
- stages: set[str],
- name: str,
- title: str,
- author: str,
- version: str =
'', - contact: str | None =
None, - homepage: str | None =
None, - description: str | None =
None, - factorio_version: str | None =
None, - dependencies: list[str] =
['base'], - quality_required: bool =
False, - rail_bridges_required: bool =
False, - space_travel_required: bool =
False, - spoiling_required: bool =
False, - freezing_required: bool =
False, - segmented_units_required: bool =
False, - expansion_shaders_required: bool =
False, - enabled: bool =
True, - **kwargs,
Mod object that stores metadata during the load process. Mostly used for structuring the data and determining the load order.
- setup_archive(archive: ZipFile, archive_folder: str)¶
Initialize the internal structure with archive data.
- setup_folder()¶
Initialize the internal structure with folder data.