Skip to content
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
wants to merge 211 commits into
base: main
Choose a base branch
from
Draft

v5 devel branch #307

wants to merge 211 commits into from

Conversation

mara004
Copy link
Member

@mara004 mara004 commented Apr 4, 2024

No description provided.

mara004 added 8 commits April 4, 2024 15:48
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 mara004 force-pushed the devel_new branch 2 times, most recently from e18a049 to 94342f8 Compare April 4, 2024 20:41
Removed PdfDocument.render() & PdfBitmapInfo.
Implemented context manager support for PdfDocument.

Test suite integration TBD.
@mara004 mara004 force-pushed the devel_new branch 10 times, most recently from 2d1c805 to 8049d8e Compare April 4, 2024 21:39
mara004 added 5 commits April 5, 2024 00:02
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

This comment was marked as outdated.

@mara004 mara004 force-pushed the devel_new branch 2 times, most recently from 55d4048 to 2675c7b Compare January 15, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants