core.df module¶
Code relating to a specific Dwarf Fortress installation.
- class core.df.DFInstall(path)[source]¶
Bases:
object
Contains properties and paths for a given Dwarf Fortress installation.
- detect_variations()[source]¶
Detect known variations to allow the launcher to adjust accordingly. Currently supports DFHack, TWBT, and legacy builds.
- class core.df.Version(version)[source]¶
Bases:
object
Container for a version number for easy comparisons.
- core.df.cycle_option(field)[source]¶
Cycles an option field between its possible values.
- Parameters:
field – the field to cycle.
- core.df.do_rawlint(path)[source]¶
Runs the raw linter on the specified directory.
- Returns:
bool – True if all files in the directory passed the linter.
- core.df.find_df_folder()[source]¶
Tries to select a Dwarf Fortress folder. The set of valid folders is first detected. If a folder name is passed as the first argument to the script, that folder will be used. Otherwise, if only one valid folder was detected, that one will be selected.
- core.df.find_df_folders()[source]¶
Locates all suitable Dwarf Fortress installations (folders starting with “Dwarf Fortress” or “df”)
- core.df.install_extras()[source]¶
Installs extra utilities to the Dwarf Fortress folder, if this has not yet been done.
- core.df.perform_checks()[source]¶
Performs various automated tasks and quits the program. Return code is 0 if all went well.
- core.df.restore_defaults()[source]¶
Copy default settings into the selected Dwarf Fortress instance.