DEP: Replace PdfWriter method add_js - #3979
Conversation
Replace add_js with add_action. The more generic name gives extensibility if more action types are implemented.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3979 +/- ##
=======================================
Coverage 97.98% 97.98%
=======================================
Files 57 57
Lines 11104 11111 +7
Branches 2080 2080
=======================================
+ Hits 10880 10887 +7
Misses 125 125
Partials 99 99 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This method would be better called The value of OpenAction (2.0 specification):
Thus this would be better, with the method having different paths on which type it is given (using @stefan6419846 as well as your code review, welcome guidance on the above changes. |
stefan6419846
left a comment
There was a problem hiding this comment.
This method would be better called
open_action.add_actionis used for the AA key entry in a page object. There is also an AA key entry in the catalog dictionary.
I am sorry, but I have some trouble following what you try to say here.
Thus this would be better, with the method having different paths on which type it is given (using
isinstance):
open_action(self, action: Action | Destination)
open_action sounds like a property and not like a method to change/add something here. A Destination is no action, thus the name would be confusing.
Put implementation in Action class.
Fix code style issues
How about |
Replace add_js with add_action. The more generic name gives
extensibility if more action types are implemented.
Closes #3776.