plesty.server.reexec
How plesty-server starts another copy of itself.
Jobs and the detached launcher are plesty-server processes too. From a
source checkout that is python -m plesty.server …; inside a PyInstaller
bundle there is no interpreter to give -m to — sys.executable is
plesty-server, and the same arguments go straight to it. This module is
the one place that knows the difference, so nothing else asks sys.frozen.
Attributes
Functions
|
Whether this process runs from a PyInstaller bundle. |
|
The executable that runs |
|
The interpreter that can own a console: |
|
The command line that runs |
|
The command line that starts the detached launcher (see |
|
One line saying how argv will be run (for logs). |
Module Contents
- plesty.server.reexec.CONSOLE_EXECUTABLE = 'plesty-server'
- plesty.server.reexec.frozen() bool
Whether this process runs from a PyInstaller bundle.
- Return type:
bool
- plesty.server.reexec.program() str
The executable that runs
plesty-servercommands.In a bundle that is the console executable beside
sys.executable— neversys.executableitself, which may be the windowedplesty-server-guiwhose entry point turns every invocation intogui. From source it is the interpreter.- Return type:
str
- plesty.server.reexec.console_interpreter() str
The interpreter that can own a console:
python.exe, neverpythonw.exe.Windows gives a console only to a console-subsystem program, so
CREATE_NEW_CONSOLEis a no-op forpythonw.exe— a windowed process asks for a console and gets nothing. Its console-subsystem child then finds no console to inherit and Windows gives that one a new, visible console: a terminal in front of the operator every time a device server starts. Under the Qt consolesys.executableispythonw.exe, so anything that re-executes us must ask for its console-owning twin. The same reasoning asprogram(), one level down.- Return type:
str
- plesty.server.reexec.self_command(*args: str) list[str]
The command line that runs
plesty-server <args>with this same program.- Parameters:
args (str) – Arguments for
plesty-server.- Return type:
list[str]
- plesty.server.reexec.launcher_command() list[str]
The command line that starts the detached launcher (see
services.launch).From source it is the launch module itself, so the waiter stays a small process that never imports click; in a bundle it is the hidden
_launchcommand of the one executable there is. Either way it is the console program: the waiter owns the hidden console its children inherit, and a windowed one cannot (console_interpreter()).- Return type:
list[str]
- plesty.server.reexec.describe(argv: collections.abc.Sequence[str]) str
One line saying how argv will be run (for logs).
- Parameters:
argv (collections.abc.Sequence[str])
- Return type:
str