Skip to content

DEP: Rename names to be PEP8-compliant#967

Merged
MartinThoma merged 20 commits intomainfrom
pep8-deprecations
Jun 19, 2022
Merged

DEP: Rename names to be PEP8-compliant#967
MartinThoma merged 20 commits intomainfrom
pep8-deprecations

Conversation

@MartinThoma
Copy link
Copy Markdown
Member

@MartinThoma MartinThoma commented Jun 9, 2022

PdfWriter.get_page: the pageNumber parameter is renamed to page_number

PyPDF2.filters:

  • For all classes, a parameter rename: decodeStreamData ➔ decode_stream_data

PyPDF2.xmp:

  • XmpInformation.rdfRoot ➔ XmpInformation.rdf_root
  • XmpInformation.xmp_createDate ➔ XmpInformation.xmp_create_date
  • XmpInformation.xmp_creatorTool ➔ XmpInformation.xmp_creator_tool
  • XmpInformation.xmp_metadataDate ➔ XmpInformation.xmp_metadata_date
  • XmpInformation.xmp_modifyDate ➔ XmpInformation.xmp_modify_date
  • XmpInformation.xmpMetadata ➔ XmpInformation.xmp_metadata
  • XmpInformation.xmpmm_documentId ➔ XmpInformation.xmpmm_document_id
  • XmpInformation.xmpmm_instanceId ➔ XmpInformation.xmpmm_instance_id

PyPDF2.generic:

  • readHexStringFromStream ➔ read_hex_string_from_stream
  • initializeFromDictionary ➔ initialize_from_dictionary
  • createStringObject ➔ create_string_object
  • TreeObject.hasChildren ➔ TreeObject.has_children
  • TreeObject.emptyTree ➔ TreeObject.empty_tree

@MartinThoma MartinThoma force-pushed the pep8-deprecations branch 2 times, most recently from 6e6e657 to 24e2ac4 Compare June 9, 2022 19:42
PdfWriter.get_page: the pageNumber parameter is renamed to page_number
PyPDF2.generic:

* readHexStringFromStream ➔ read_hex_string_from_stream
* TreeObject.emptyTree ➔ TreeObject.empty_tree

xmp:

* XmpInformation.rdfRoot ➔ XmpInformation.rdf_root
* XmpInformation.xmp_createDate ➔ XmpInformation.xmp_create_date
* XmpInformation.xmp_creatorTool ➔ XmpInformation.xmp_creator_tool
* XmpInformation.xmp_metadataDate ➔ XmpInformation.xmp_metadata_date
* XmpInformation.xmp_modifyDate ➔ XmpInformation.xmp_modify_date
* XmpInformation.xmpMetadata ➔ XmpInformation.xmp_metadata
* XmpInformation.xmpmm_documentId ➔ XmpInformation.xmpmm_document_id
* XmpInformation.xmpmm_instanceId ➔ XmpInformation.xmpmm_instance_id
@MartinThoma MartinThoma marked this pull request as ready for review June 9, 2022 19:49
@MartinThoma
Copy link
Copy Markdown
Member Author

I'm still undecided how to deal with the decodeParms parameter. Maybe just parameters?

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 9, 2022

Codecov Report

Merging #967 (1ab1b3e) into main (797963a) will increase coverage by 0.03%.
The diff coverage is 94.91%.

@@            Coverage Diff             @@
##             main     #967      +/-   ##
==========================================
+ Coverage   89.23%   89.27%   +0.03%     
==========================================
  Files          19       19              
  Lines        4423     4437      +14     
  Branches      923      921       -2     
==========================================
+ Hits         3947     3961      +14     
  Misses        323      323              
  Partials      153      153              
Impacted Files Coverage Δ
PyPDF2/filters.py 83.71% <81.81%> (ø)
PyPDF2/generic.py 91.53% <95.23%> (+<0.01%) ⬆️
PyPDF2/_encryption.py 72.85% <100.00%> (ø)
PyPDF2/_security.py 94.80% <100.00%> (ø)
PyPDF2/_writer.py 88.92% <100.00%> (ø)
PyPDF2/xmp.py 88.83% <100.00%> (+0.78%) ⬆️

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 797963a...1ab1b3e. Read the comment docs.

@MartinThoma MartinThoma added the soon PRs that are almost ready to be merged, issues that get solved pretty soon label Jun 10, 2022
* FlateDecode.decode
* ASCIIHexDecode.decode
* LZWDecode.decode
* ASCII85Decode.decode
* DCTDecode.decode
* JPXDecode.decode
* CCITTFaxDecode.decode
initializeFromDictionary -> initialize_from_dictionary
TreeObject.hasChildren -> TreeObject.has_children
createStringObject -> create_string_object
@MartinThoma
Copy link
Copy Markdown
Member Author

I want to wait until #969 is merged so that @pubpub-zz does not have to deal with merge conflicts.

@MartinThoma MartinThoma merged commit 953a11d into main Jun 19, 2022
@MartinThoma MartinThoma deleted the pep8-deprecations branch June 19, 2022 07:27
MartinThoma added a commit that referenced this pull request Jun 19, 2022
The highlight of this release is improved support for file encryption
(AES-128 and AES-256, R5 only). See #749 for the amazing work of
@exiledkingcc 🎊 Thank you 🤗

Deprecations (DEP):
-  Rename names to be PEP8-compliant (#967)
  - `PdfWriter.get_page`: the pageNumber parameter is renamed to page_number
  - `PyPDF2.filters`:
    * For all classes, a parameter rename: decodeParms ➔ decode_parms
    * decodeStreamData ➔ decode_stream_data
  - `PyPDF2.xmp`:
    * XmpInformation.rdfRoot ➔ XmpInformation.rdf_root
    * XmpInformation.xmp_createDate ➔ XmpInformation.xmp_create_date
    * XmpInformation.xmp_creatorTool ➔ XmpInformation.xmp_creator_tool
    * XmpInformation.xmp_metadataDate ➔ XmpInformation.xmp_metadata_date
    * XmpInformation.xmp_modifyDate ➔ XmpInformation.xmp_modify_date
    * XmpInformation.xmpMetadata ➔ XmpInformation.xmp_metadata
    * XmpInformation.xmpmm_documentId ➔ XmpInformation.xmpmm_document_id
    * XmpInformation.xmpmm_instanceId ➔ XmpInformation.xmpmm_instance_id
  - `PyPDF2.generic`:
    * readHexStringFromStream ➔ read_hex_string_from_stream
    * initializeFromDictionary ➔ initialize_from_dictionary
    * createStringObject ➔ create_string_object
    * TreeObject.hasChildren ➔ TreeObject.has_children
    * TreeObject.emptyTree ➔ TreeObject.empty_tree

New Features (ENH):
-  Add decrypt support for V5 and AES-128, AES-256 (R5 only) (#749)

Robustness (ROB):
-  Fix corrupted (wrongly) linear PDF (#1008)

Maintenance (MAINT):
-  Move PDF_Samples folder into ressources
-  Fix typos (#1007)

Testing (TST):
-  Improve encryption/decryption test (#1009)
-  Add merger test cases with real PDFs (#1006)
-  Add mutmut config

Code Style (STY):
-  Put pure data mappings in separate files (#1005)
-  Make encryption module private, apply pre-commit (#1010)

Full Changelog: 2.2.1...2.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

soon PRs that are almost ready to be merged, issues that get solved pretty soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant