core.manifest module¶
Manages content manifests for graphics, mods, and utilities.
- core.manifest.exists(content_type, item)[source]¶
Returns a bool, that the given item has a manifest. Used before calling get_cfg if logging a warning isn’t required.
- core.manifest.get_cfg(content_type, item)[source]¶
Returns a JSONConfiguration object for the given item.
Manifest format:
The manifest is a dictionary of values, which can be saved as manifest.json in the top level of the content folder. Content is as below, except that True or False should not be capitalised. Whitespace is irrelevant. Unused lines can be left out of the file.
‘title’ and ‘tooltip’ control presentation in the list for that kind of content. Both should be strings. Title is the name in the list; tooltip is the hovertext - linebreaks are inserted with
\n
, since it must be one ine in the manifest file.‘folder_prefix’ controls what the name of the graphics pack’s folder must begin with.
‘author’ and ‘version’ are strings for the author and version of the content. Both are for information only at this stage.
‘df_min_version’, ‘df_max_version’, and ‘df_incompatible_versions’ allow you to specify versions of DF with which the content is incompatible. Versions are strings of numbers, of the format ‘0.40.24’. Min and max are the lowest and highest compatible versions; anything outside that range has the content hidden. If they are not set, they assume all earlier or later versions are compatible. incompatible_versions is a list of specific versions which are incompatible, for when the range alone is insufficient.
‘needs_dfhack’ is a boolean value, and should only be True if the content does not function at all without DFHack. Partial requirements can be explained to the user with the ‘tooltip’ field.
- Parameters:
content_type – ‘graphics’, ‘mods’, or ‘utilities’
item – content identifier path segment, such that the full path is
'LNP/content_type/item/*'
- Returns:
core.json_config.JSONConfiguration – manifest object