python-lnp
python-lnp copied to clipboard
Additional importer strategies
The importer now basically works - config issues aside - and the existing strategies are sufficient for most cases. My old script only ever used one, and was far less robust! This list therefore records ideas that may be implemented, but are considered low priority. Basically I want to save the notes somewhere safe...
-
init files: handle
init.txt
andd_init.txt
as for graphics packs, for the inverse set of options. Only available for importing from the same DF version, which will require some refactoring to point the version detector at another DF dir. -
keybindings: use internal (ordereddict) format from
core/keybinds.py
to compare, to vanilla from the old DF version. Save minimised version toLNP/Keybinds/
only if the same set is not already present. -
graphics: install the same graphics pack as was on the old pack, if available.
-
Embark profiles: tricky to do much better than just pointing the
copy_add
strategy atLNP/Embarks
, but probably worth trying. -
World-gen profiles: requires PyLNP to handle these, which we currently don't. Mentioned for completeness.
[Issue created by PeridexisErrant: 2016-08-09] [Last updated on bitbucket: 2016-09-15]
[Comment created by Pidgeot: 2016-09-15]
we also want to log a warning when a concrete import path does not exist.
I'm actually not so sure about that. If a path doesn't exist, that just means there isn't anything to import from it.
Just take the current set of files to be imported: it includes soundsense data, which is of course not going to be there if the user isn't using soundsense.
[Comment created by jecowa: 2016-09-15] Could using a blacklist instead of a whitelist help out with avoiding wildcards? Maybe have it grab every file out of the "df" folder that isn't part of a fresh vanilla install or related to DFHack.
[Comment created by PeridexisErrant: 2016-09-15]
Sounds fine in principle - just needs careful execution. Eg the obvious way to do this is to pass all files to glob.glob
and flatten the list, but we also want to log a warning when a concrete import path does not exist. Given that we can't complicate the config any further, this wil probably involve fragile code like if '*' in path: ...
which I'm not super keen on. Clearly it would be useful though, so practicality beats purity!
[Comment created by carter_scottm: 2016-09-13]
What about adding support for wildcards in file and folder names? This would allow users to import previously saved legends exports (whether in native format or compressed by PyLNP) by adding the following to the to_import
section:
["copy_add","<df>/*-bm.*"],
["copy_add","<df>/*-dip.*"],
["copy_add","<df>/*-drn.*"],
["copy_add","<df>/*-el.*"],
["copy_add","<df>/*-elw.*"],
["copy_add","<df>/*-evil.*"],
["copy_add","<df>/*-hyd.*"],
["copy_add","<df>/*-nob.*"],
["copy_add","<df>/*-rain.*"],
["copy_add","<df>/*-sal.*"],
["copy_add","<df>/*-sav.*"],
["copy_add","<df>/*-str.*"],
["copy_add","<df>/*-tmp.*"],
["copy_add","<df>/*-trd.*"],
["copy_add","<df>/*-veg.*"],
["copy_add","<df>/*-vol.*"],
["copy_add","<df>/*-world_map.*"],
["copy_add","<df>/-site_map-*"],
["copy_add","<df>/*-detailed.*"],
["copy_add","<df>/*-legends.xml"],
["copy_add","<df>/*-legends_plus.xml"],
["copy_add","<df>/*-world_history.txt"],
["copy_add","<df>/*-world_sites_and_pops.txt"],
["copy_add","<df>/*-world_gen_param.txt"],
["copy_add","<df>/*_legends_exports/"],
[Comment created by McArcady: 2016-08-26] Had & fixed some troubles with the importer under Linux / Python2 - see my pull request.