core.lnp module¶
PyLNP main library.
- class core.lnp.PyLNP[source]¶
Bases:
object
PyLNP library class.
Acts as an abstraction layer between the UI and the Dwarf Fortress instance.
- class core.lnp.UI[source]¶
Bases:
object
Specifies the interface required by the core PyLNP library for communicating with the user. Provided for reference; UIs do not need to inherit from this.
- on_invalid_config(errors)[source]¶
Called before running DF if an invalid configuration is detected. <errors> contains a list of discovered problems, which should be shown to the user. A true return value will launch DF anyway; a false return value cancels.
- on_program_running(path, is_df)[source]¶
Called when attempting to launch a program that is already running. <path> provides the path to the program that is being launched, so you can request a forced launch. <is_df> specifies if the program is DF (True) or a utility (False).
- on_query_migration()[source]¶
When no saves are detected, this function will be called. This should provide the user with an option to import a previous DF install or starter pack into the newly selected DF version.
- on_request_update_permission(interval)[source]¶
Called when PyLNP.json specifies a desired update interval but the user configuration does not hold a value for this. <interval> contains the number of days between update checks. A true return value will change the configuration to use the specified interval. A false return value will turn off automatic update checks.