-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PyPDF4: check if there were important improvements on PyPDF2 #817
Closed
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
Several style reformattings were added to source code files that were not following PEP 8 style conventions. The files residing in `PyPDF4/` were excluded from the process.
`.gitignore` was also updated.
The renaming process was done manually and arbitrarily. Occurrences within `CHANGELOG` or a few in `README.md` weren't modified.
Some further code was reformatted to conform to PEP 8 style conventions. TO-DOs, minor refactorings and a few code changes beside testing batteries were added to.
Fortification of the test suite is always welcome. I also am thankful for the other corrections Oscar introduced.
Too many and too little to document them all.
Very small changes were added elsewhere too.
`str_()` is now `pypdfStr()`, `ord_()` is `pypdfOrd()`, `b_()` is `pypdfBytes()` and so on. In case a user wishes to retain the old names, such functions can be imported as ``` from PyPDF4.utils import pypdfStr as str_, pypdfBytes as b_ # ... ```
The `staticmethod()` feature was first added in version 2.2 of Python, with the decorator syntax being added in 2.4: [source](https://docs.python.org/2.7/library/functions.html#staticmethod).
`pypdfOrd()` in `PyPDF4/utils.py` was updated too.
This version of the encoder is primarily meant to aid testing of `LZWDecode.Decoder`. It does not interpret optional parameters and may contain a few bugs as of this commit.
An encode() method had to be added in ASCII85Decode specifically for testing purposes. A bug in the Python 2 implementation of ASCII85Decode.decode() was potentially found.
… 2 and 3. The bug manifested solely in the Python 2 version of the code, which has been deleted now (sorry, but it's a little cumbersome to maintain **two** distinct implementations of an algorithm at once - the one stored now is efficient and works seamlessly for both Python 2 and Python 3!). TO-DO: the current decode() algorithm doesn't verify the ending `~>` EOD sequence in an ASCII85-encoded sequence.
These should be considered "scratching scripts" for now, so not a lot of development time was spent on them. However, it was ensured that they work properly, like not they were doing before.
fix PDF writer bug when encountering free object
…wice Fixed addJS running twice
* Local imports imports made local to have concurrent versions in parallel & upgrade version * Fix Reading Files fix regression since 1.27.0 in encoded stream loading and extraction of XRefStm and Prev in trailer * Lazy file/stream selection Provide capability to provide the filename/stream only when calling write * Add Clone capability Provide capability to copy pages and objects from a reader into a writer. Provide also capability to copy a full reader into a writer * Add PageLabel access functions implement PageLabels functions both in Reader (get) and Writer (get/add/remove) * Object Standardization Create _rootObject in Reader to match Writer and also introduce a getIndirectionFunction on both Reader and Writer * Enhance NamedDestinations functions Extend NamedDestinations to work with PDF 1.1 and 1.2+ with both get/insert/remove functions Also complete/fix some issues with outlines * enhance pages api for writer Provide capability to work with non flatten pages organisation for bot insertion,get and remove page * Add comment capability implements functions to add comments to a Page * Remove Links / Annots improve removeLinks into removeAnnots to be able to select which type of annots to remove removeLinks kept for compatility * add demo programs on comments Add 2 tests programs for test and demo about comments (merging comments and Listing them in an excel sheet)
* fix chr-ord confusion in TextStringObject.writeToStream * added tests for TextStringObject.writeToStream * fix TextStringObject.writeToStream in a python2 compatible way
* add attachFiles function * add docstring * reformat * add test for addAttachment Added a unit test for the addAttachment function because it was missing. * add test for attachFiles Added a unit test for the attachFiles function. * replace ntpath by os.path Compatibility. * fix tests Replaced paths within fixture_data directory by temporary files.
pylint, and so on.
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.