Import user content from an old DF or Starter Pack install.
The content to import is defined in PyLNP.json
Two import strategies are currently supported:
copy a file or directory contents, non-recursive, no overwriting
prepend imported file content (for logfiles)
These strategies support the ‘low hanging fruit’ of imports. Other content or more advanced strategies have been identified, but are difficult to implement without risking a ‘bad import’ scenario:
- init files
Not simply copyable. Sophisticated merging (similar to graphics upgrades) may lead to bad config when using settings from an older version of DF. Will not be supported.
Could be imported by minimising interface.txt (and
LNP/Keybinds/*) (see core/keybinds.py), and copying if a duplicate set is not yet available. Planned for future update.
- world_gen, embark_profiles
Importing world gen and embark profiles may be supported eventually. No obvious downsides beyond tricky implementation.
Custom settings importer - eg which graphics pack, are aquifers disabled, other PyLNP settings… May be added later but no plans.
Import content (defined in PyLNP.json) from the given previous df_dir, and associated LNP install if any.
Copy a file or directory contents from src to dest, without overwriting. If a single file, an existing file may be overwritten if it only contains whitespace. For directory contents, only the top level is ‘filled in’.
Log error if an unknown strategy is attempted.
Prepend the src textfile to the dest textfile, creating it if needed.