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

Add PageObject to __init__.py #960

Merged
merged 1 commit into from Jun 8, 2022
Merged

Add PageObject to __init__.py #960

merged 1 commit into from Jun 8, 2022

Conversation

xilopaint
Copy link
Contributor

@xilopaint xilopaint commented Jun 8, 2022

Currently, accessing the PageObject.create_blank_page static method depends on importing PageObject with something like from PyPDF2._page import PageObject. It feels weird as the leading underscore indicates that the _page module should not be imported directly.

This PR adds PageObject to __init__.py allowing it to be imported in a cleaner way with from PyPDF2 import PageObject.

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #960 (c3124b7) into main (23a8042) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #960   +/-   ##
=======================================
  Coverage   84.36%   84.36%           
=======================================
  Files          18       18           
  Lines        4080     4080           
  Branches      858      858           
=======================================
  Hits         3442     3442           
  Misses        451      451           
  Partials      187      187           
Impacted Files Coverage Δ
PyPDF2/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23a8042...c3124b7. Read the comment docs.

@MartinThoma
Copy link
Member

@xilopaint what do you need the page object for? Why do you need to import it?

@xilopaint
Copy link
Contributor Author

xilopaint commented Jun 8, 2022

I need it for using the PageObject.create_blank_page method.

@MartinThoma MartinThoma merged commit a7dc370 into py-pdf:main Jun 8, 2022
@MartinThoma
Copy link
Member

Nice! Thank you for explaining it - makes sense to me :-) It will be part of the next release. It's not yet planned when this will be, but some time this month for sure :-) (in the current pace rather this week 😅 )

MartinThoma added a commit that referenced this pull request Jun 12, 2022
New Features (ENH):
-  Add support for pathlib as input for PdfReader (#979)

Performance Improvements (PI):
-  Optimize read_next_end_line (#646)

Bug Fixes (BUG):
-  Adobe Acrobat \'Would you like to save this file?\' (#970)

Documentation (DOC):
-  Notes on annotations (#982)
-  Who uses PyPDF2
-  intendet \xe2\x9e\x94 in robustness page  (#958)

Maintenance (MAINT):
-  pre-commit / requirements.txt updates (#977)
-  Mark read_next_end_line as deprecated (#965)
-  Export `PageObject` in PyPDF2 root (#960)

Testing (TST):
-  Add MCVE of issue #416 (#980)
-  FlateDecode.decode decodeParms (#964)
-  Xmp module (#962)
-  utils.paeth_predictor (#959)

Code Style (STY):
-  Use more tuples and list/dict comprehensions (#976)

Full Changelog: 2.1.0...2.1.1
pubpub-zz added a commit to pubpub-zz/pypdf that referenced this pull request Jun 14, 2022
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.

None yet

2 participants