-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5 devel branch #307
Draft
mara004
wants to merge
150
commits into
main
Choose a base branch
from
devel_new
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
v5 devel branch #307
Conversation
This file contains 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
This backports (and slightly improves) the new bookmark API from devel_new. Test suite TBD.
Note the following test script: ``` import io import sys import logging import contextlib logger = logging.getLogger("testLogger") logger.setLevel(logging.DEBUG) buf = io.StringIO() logger.addHandler(logging.StreamHandler(buf)) # ! with contextlib.redirect_stdout(buf), contextlib.redirect_stderr(buf): print("print to stdout") print("print to stderr", file=sys.stderr) logger.info("info message") logger.warning("warning message") print(f"{buf.getvalue()!r}") ``` Like this, we get: > 'print to stdout\nprint to stderr\ninfo message\nwarning message\n' Without handler: > 'print to stdout\nprint to stderr\nwarning message\n' With default handler: > info message > warning message > 'print to stdout\nprint to stderr\n' Weird.
mara004
force-pushed
the
devel_new
branch
2 times, most recently
from
April 4, 2024 20:41
e18a049
to
94342f8
Compare
Removed PdfDocument.render() & PdfBitmapInfo. Implemented context manager support for PdfDocument. Test suite integration TBD.
mara004
force-pushed
the
devel_new
branch
10 times, most recently
from
April 4, 2024 21:39
2d1c805
to
8049d8e
Compare
Use bool() rather than checking against None. See findings in get_toc(): "We need bool(ptr) here to handle cases where .contents is a null pointer (raises exception on access). Don't use ptr != None, it's always true."
This is longer, but cleaner. Imagine you have to edit it and assignment order gets wrong :P BTW, normalize PdfFormEnv constructor param order.
mara004
force-pushed
the
main
branch
6 times, most recently
from
September 19, 2024 14:44
15b9478
to
6736a5d
Compare
It is not clear to me if PDFium is "BSD-3-Clause OR Apache-2.0" or "BSD-3-Clause AND Apache-2.0". The pypdfium2 codebase previously stated "OR", but recently it hit me we don't actually have any evidence for that. In the end, I figured it was probably a presumption from the early days of the project that might as well be wrong, and that "BSD-3-Clause AND Apache-2.0" would have been the safer assumption. Sorry :( IANAL, but to my understanding both licenses are liberal and in similar spirit, so hopefully this should not have negative legal consequences downstream. Note that there is (and always was) ABSOLUTELY NO WARRANTY for any information provided with the pypdfium2 project. For pypdfium2's Readme, see the CC-BY-4.0 license (e.g. "Section 5 -- Disclaimer of Warranties and Limitation of Liability."). For pypdfium2's code (including any information provided therein), see the Apache-2.0 or BSD-3-Clause licenses, which have similar disclaimers. This patch avoids any "OR" or "AND", instead changing to a generic comma. This is not valid SPDX/reuse syntax and serves as a placeholder until we know better. Note that pypdfium2's Python code continues to be "Apache-2.0 OR BSD-3-Clause". This issue is only about PDFium itself.
had two consecutive use_syslibs if-blocks that could be merged into one.
having a mutable default parameter is dangerous / bad practice (although it was not immediately harmful in this instance)
alternatively, we could put the + on the beginning of the other line but in this case it's easiest to just omit it
Conflicts (manually resolved): docs/devel/changelog_staging.md tests/expectations/toc_maxdepth.txt tests_old/test_pageobject.py
I don't think there were any actual issues, but in general this is just too risky.
Unfortunately, colour post-processing destroys LCD optimization
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.
No description provided.