Repository navigation
feat: add --cli mode to p2pp for headless/CI processing - #108
Merged
Merged
Conversation
markballew
force-pushed
the
feat/issue-107
branch
from
August 27, 2026 22:34
af95cd2 to
d8a9ccb
Compare
…p, path fallback)
- p2pp/headless.py: Qt-free shim with same API as p2pp/gui.py - P2PP.py: installs shim via sys.modules before any p2pp imports - All modules that do 'import p2pp.gui as gui' get the shim automatically - No QApplication, no event loop, no image_rc dependency - Reverts try/except changes in other files (shim handles it cleanly) - p2pp_process_file_cli sets cli_mode for mcf.py's helper functions
p3_upload.py imports PyQt5 directly and creates QWidget objects at module level (uic.loadUiType → Window()). In headless mode these crash because no QApplication exists. Fix: check P2PP_HEADLESS env var and skip all PyQt5 widget creation. Tested locally — import succeeds without Qt. Also: P2PP.py sets P2PP_HEADLESS=1 before installing the sys.modules shim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #107. Adds --cli flag to run p2pp without GUI dependencies. In CLI mode, PyQt and image_rc are not imported, processing runs headless, and results are printed to stdout. Exits with code 0 on success, 1 on failure.