adsfolio.gui.jobs

Qt subprocess helpers for running the existing adsfolio CLI.

class adsfolio.gui.jobs.CommandJob(argv, parent=None, *, working_directory=None, root=None, follow_up_argv=())[source]

Bases: PySide6.QtCore.QObject

Run an adsfolio CLI subcommand and stream complete output lines.

Parameters:
  • argv (list[str]) – Full argv, including the executable at index zero.

  • parent (QObject, optional) – Qt parent object.

  • working_directory (Path or str, optional) – Directory in which to run the command. The GUI passes the selected library root so relative CLI paths have the same semantics as the CLI.

  • follow_up_argv (sequence of sequences of str, optional) – Commands to run in order after successful completion. A failed or cancelled command stops the sequence.

  • root (Path or str, optional) – Backward-compatible alias for working_directory used by the dialogs.

cancel()[source]

Request termination, escalating to a kill after three seconds.

Return type:

None

failed
finished
output
property running: bool[source]

Whether the underlying process is still running.

start()[source]

Start the subprocess and return immediately.

Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("CommandJob" inherits "QObject": Methods:   #4 type=Signal, signature=output(QString), parameters=QString   #5 type=Signal, signature=finished(int), parameters=int   #6 type=Signal, signature=failed(QString), parameters=QString )
class adsfolio.gui.jobs.JsonWorkerJob(parent=None)[source]

Bases: PySide6.QtCore.QObject

Run a hidden adsfolio pdf worker command in a child process.

The job writes request.json to a private temporary directory, starts adsfolio pdf COMMAND REQUEST, and reads result.json after the child exits. A child process keeps Python work off the window’s interpreter lock, so the window stays responsive. finished carries (payload, error).

Subclasses set command and fill request after this initializer.

Parameters:

parent (QObject | None)

cancel()[source]

Ask the child to stop at its next check by creating the cancel file.

Return type:

None

command = ''
finished
request: dict[str, Any]
property running: bool[source]

Return whether the worker still needs to finish.

start()[source]

Write the request and start the child process once.

Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("JsonWorkerJob" inherits "QObject": Methods:   #4 type=Signal, signature=finished(PyObject,PyObject), parameters=PyObject, PyObject )
adsfolio.gui.jobs.cli_argv(*args)[source]

Build CLI arguments for an installed package or a desktop bundle.

Parameters:

*args (str) – CLI arguments, passed unchanged without shell interpretation.

Returns:

Command using the bundled console helper when frozen, otherwise the current Python interpreter. The helper shares the GUI’s dependencies and provides output pipes even when the GUI has no console on Windows.

Return type:

list[str]