Caution
This API is not finalised, and may change in a patch version.
installer.scripts¶
Provides the ability to generate executable launcher scripts, that are based on
simple_launcher. A description of how these scripts work is available in
simple_launcher’s README.
- class installer.scripts.InvalidScript¶
Raised if the user provides incorrect script section or kind.
- __new__(**kwargs)¶
- __init__(*args, **kwargs)¶
- class installer.scripts.Script¶
Describes a script based on an entry point declaration.
- __init__(name, module, attr, section)¶
Construct a Script object.
- Parameters
name (str) – name of the script
module (str) – module path, to load the entry point from
attr (str) – final attribute access, for the entry point
section (str) – Denotes the “entry point section” where this was specified. Valid values are
"gui"and"console".
- Return type
None
- generate(executable, kind)¶
Generate a launcher for this script.
- Parameters
executable (str) – Path to the executable to invoke.
kind (str) – Which launcher template should be used. Valid values are
"posix","win-ia32","win-amd64"and"win-arm".
- Raises
InvalidScript – if no appropriate template is available.
- Returns
The name and contents of the launcher file.
- Return type
Tuple[str, bytes]