-
Notifications
You must be signed in to change notification settings - Fork 247
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
Refactor number of pages alias (fix #1090) #1203
base: master
Are you sure you want to change the base?
Conversation
self.pages: Dict[int, PDFPage] = ( | ||
{} | ||
) # array of PDFPage objects starting at index 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.pages: Dict[int, PDFPage] = ( | |
{} | |
) # array of PDFPage objects starting at index 1 | |
# array of PDFPage objects starting at index 1: | |
self.pages: Dict[int, PDFPage] = {} |
Just a suggestion to make the code clearer
self._render_args = args | ||
self._render_kwargs = kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't those attributes be defined in the constructor?
@@ -5158,8 +5175,14 @@ def output( | |||
# Generating .buffer based on .pages: | |||
if self._toc_placeholder: | |||
self._insert_table_of_contents() | |||
if self.str_alias_nb_pages: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing this IF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alias = "A different name for something"
That's not really what we're dealing with here, at all.
Yes, I know that .str_alias_nb_pages
has had that name for like forever, but maybe we shouldn't propagate it to all the internal code dealing with text substitution.
In #1202 I tried to use terminology that describes better what really happens. I probably haven't found the absolute best wording, but it may help as a more reasonable starting point.
Using names that don't actually reflect the purpose of the named elements makes the code really confusing to read and hard to understand. I'm not a native english speaker, but I like to be as precise as possible about those things.
Other than that, I expect the result to "just work"... 😉
e.g. Fixes #0
Checklist:
The GitHub pipeline is OK (green),
meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.A unit test is covering the code added / modified by this PR
This PR is ready to be merged
In case of a new feature, docstrings have been added, with also some documentation in the
docs/
folderA mention of the change is present in
CHANGELOG.md
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.