Skip to content

Commit

Permalink
PPF-760: more appropriate function name
Browse files Browse the repository at this point in the history
  • Loading branch information
chinapandaman committed Dec 6, 2024
1 parent 95e2655 commit 905bc77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions PyPDFForm/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@ def get_paragraph_auto_wrap_length(widget_middleware: Text) -> int:
return result


def update_widget_key(
def update_widget_keys(
template: bytes,
widgets: Dict[str, WIDGET_TYPES],
old_keys: List[str],
new_keys: List[str],
indices: List[int],
) -> bytes:
"""Updates the key of a widget."""
"""Updates a list of keys of widgets."""
# pylint: disable=R0801

pdf = PdfReader(stream_to_io(template))
Expand Down
6 changes: 3 additions & 3 deletions PyPDFForm/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .middleware.text import Text
from .template import (build_widgets, dropdown_to_text,
set_character_x_paddings, update_text_field_attributes,
update_widget_key, widget_rect_watermarks)
update_widget_keys, widget_rect_watermarks)
from .utils import (get_page_streams, merge_two_pdfs, preview_widget_to_draw,
remove_all_widgets)
from .watermark import create_watermarks_and_draw, merge_watermarks_with_pdf
Expand Down Expand Up @@ -252,7 +252,7 @@ def update_widget_key(
return self

self.__init__(
template=update_widget_key(
template=update_widget_keys(
self.read(), self.widgets, [old_key], [new_key], [index]
),
global_font=self.global_font,
Expand All @@ -270,7 +270,7 @@ def commit_widget_key_updates(self) -> PdfWrapper:
indices = [each[2] for each in self._keys_to_update]

self.__init__(
template=update_widget_key(
template=update_widget_keys(
self.read(), self.widgets, old_keys, new_keys, indices
),
global_font=self.global_font,
Expand Down

0 comments on commit 905bc77

Please sign in to comment.