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

mixed documentation of PDF.close() and Page.flush_cache() in README #1042

Closed
luketudge opened this issue Nov 7, 2023 · 3 comments
Closed
Labels

Comments

@luketudge
Copy link

luketudge commented Nov 7, 2023

Something is not right about the main README and perhaps needs updating.

The explanation of PDF.close() here mentions clearing the cache for Page objects. But calling PDF.close() does not clear the cache for the individual pages. To do that, we need Page.flush_cache(). This part of the README also suggests that .flush_cache() is deprecated in favor of .close(), but Page objects do not have a .close() method.

Maybe the documentation of PDF and Page has gotten mixed up? Clearer would be to explain here what .close() does for the PDF object, and to add documentation of cache clearing for Page objects to a different section.

@luketudge luketudge added the bug label Nov 7, 2023
jsvine added a commit that referenced this issue Nov 9, 2023
See #1042

- Re-adds `Page.close()` method
    - Was accidentally removed in 9587cc7
- Makes `PDF.close()` close all pages as well
- Improves relevant documentation
@jsvine
Copy link
Owner

jsvine commented Nov 9, 2023

Thanks for flagging this, @luketudge! It does look like things got a bit mixed up over the course of some changes. I'm proposing fixing the issue via this commit: ba58e16

It (re-)adds the missing Page.close() method, has PDF.close() close all pages, and adjusts the documentation. Does this seem right to you? Or still a bit confusing/wrong?

@luketudge
Copy link
Author

@jsvine Great! This looks exactly right. Thanks for picking it up so quickly.

@jsvine
Copy link
Owner

jsvine commented Nov 9, 2023

Super! Closing this as fixed via ba58e16

@jsvine jsvine closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants