PyLNP Developer Reference¶
This document will describe PyLNP from a developer’s perspective.
Licensing¶
PyLNP is licensed under the ISC license (see COPYING.txt
), which essentially
allows you to modify and distribute changes as you see fit. (This only
applies to the launcher. Any bundled utilities, graphics packs, etc. have
their own licenses; refer to those projects separately.)
Acquiring the source code¶
The source code is available at Github
.
If you wish to contribute to PyLNP development, a pull request will be much appreciated.
Coding guidelines¶
All source files must start with the following preamble (followed by a blank line for separation):
#!/usr/bin/env python # -*- coding: utf-8 -*- """<module docstring>"""
As a rule of thumb,
PEP 8
should be followed. In particular,pylint
should return no errors or warnings when run on the source code (using the providedpylintrc
file). Any and all messages generated bypylint
must either be fixed or explicitly suppressed on a case-by-case basis. Formatting-related messages (line length, indentation, etc.) must always be fixed. Examples of valid suppressions:PyInstaller requires a certain package to appear in an
import
statement in order to create working binaries, but the statement doesn’t need to actually run at any point in time. Here, it is valid to place theimport
statement in anif False:
block and suppress the resultingusing-constant-test
message.Inner functions defined for the purpose of callbacks are permitted to not have docstrings, but the warning for this must be suppressed for the individual function.
PyLNP is divided into two main components:
core
, which is the main application, andtkgui
, which represents the UI. The UI must only perform non-UI work by calling into functions of thecore
library. This is to simplify implementation of alternative user interfaces. Where possible,core
methods should not call into the UI; in cases where this is unavoidable, the method must be documented in theUI
class defined inlnp.py
.
List of Modules¶
- core package
- core.baselines module
- core.colors module
- core.df module
- core.dfraw module
- core.download module
- core.embarks module
- core.errorlog module
- core.graphics module
- core.hacks module
- core.helpers module
- core.importer module
- core.json_config module
- core.keybinds module
- core.launcher module
- core.legends_processor module
- core.lnp module
- core.log module
- core.manifest module
- core.mods module
- core.paths module
- core.rawlint module
- core.settings module
- core.terminal module
- core.update module
- core.utilities module
- tkgui package
- tkgui.advanced module
- tkgui.binding module
- tkgui.child_windows module
- tkgui.controls module
- tkgui.dfhack module
- tkgui.graphics module
- tkgui.layout module
- tkgui.mods module
- tkgui.options module
- tkgui.tab module
- tkgui.tkgui module
- tkgui.tkhelpers module
- tkgui.utilities module