From c5d1885252b136f88deeb417d8bee3dfa9330d80 Mon Sep 17 00:00:00 2001 From: geisserml Date: Mon, 13 Nov 2023 22:22:13 +0100 Subject: [PATCH] version: dump library loader info perhaps we'd only need the libpath (or at least not the libname), but dump the whole thing for now --- src/pypdfium2/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pypdfium2/__main__.py b/src/pypdfium2/__main__.py index 4c58fc8d5..f9d4989b6 100644 --- a/src/pypdfium2/__main__.py +++ b/src/pypdfium2/__main__.py @@ -9,6 +9,8 @@ import pypdfium2._helpers as pdfium import pypdfium2.internal as pdfium_i from pypdfium2.version import PYPDFIUM_INFO, PDFIUM_INFO +# the * import in pypdfium2.raw loses underscore-prefixed members, so import from the direct origin +from pypdfium2_raw.bindings import _loader_info as loader_info SubCommands = { "arrange": "rearrange/merge documents", @@ -36,7 +38,9 @@ def get_parser(): main_parser.add_argument( "--version", "-v", action = "version", - version = f"pypdfium2 {PYPDFIUM_INFO}\npdfium {PDFIUM_INFO}", + version = \ + f"pypdfium2 {PYPDFIUM_INFO}\n" + f"pdfium {PDFIUM_INFO}\n" + \ + "\n".join([f" {k}: {v!r}" for k, v in loader_info.items()]), ) subparsers = main_parser.add_subparsers(dest="subcommand")