Skip to content

Commit

Permalink
Rename TODO(v5) to TODO(apibreak)
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed May 13, 2023
1 parent 0cfe906 commit 065bd1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/source/planned_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<!-- Currently, no API breaking changes are planned. -->

```{note}
You may search for `TODO(v5)` to find the code spots in question.
You may search for `TODO(apibreak)` to find the code spots in question.
```

The following API breaking changes are in consideration for the next major release:
The following API breaking changes are in consideration for a future release:

- The `PdfDocument.get_toc()` / `PdfOutlineItem` API will be changed.
* The parameters `is_closed` (bool) and `n_kids` (abs int) will be replaced by `count` (int),
Expand Down
10 changes: 5 additions & 5 deletions src/pypdfium2/_helpers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def page_as_xobject(self, index, dest_pdf):
return PdfXObject(raw=raw_xobject, pdf=dest_pdf)


# TODO(v5) consider switching to a wrapper class around the raw bookmark
# TODO(apibreak) consider switching to a wrapper class around the raw bookmark
# (either with getter methods, or possibly cached properties)
def _get_bookmark(self, bookmark, level):

Expand All @@ -468,7 +468,7 @@ def _get_bookmark(self, bookmark, level):
pdfium_c.FPDFBookmark_GetTitle(bookmark, buffer, n_bytes)
title = buffer.raw[:n_bytes-2].decode('utf-16-le')

# TODO(v5) just expose count as-is rather than using two variables and doing extra work
# TODO(apibreak) just expose count as-is rather than using two variables and doing extra work
count = pdfium_c.FPDFBookmark_GetCount(bookmark)
is_closed = True if count < 0 else None if count == 0 else False
n_kids = abs(count)
Expand All @@ -494,7 +494,7 @@ def _get_bookmark(self, bookmark, level):
)


# TODO(v5) change outline API (see above)
# TODO(apibreak) change outline API (see above)
def get_toc(
self,
max_depth = 15,
Expand Down Expand Up @@ -595,7 +595,7 @@ def render(
:data:`typing.Any`: Parameter-dependent result.
"""

# TODO(v5) remove mk_formconfig parameter (bloat)
# TODO(apibreak) remove mk_formconfig parameter (bloat)

if not isinstance(self._input, (Path, str)):
raise ValueError("Can only render in parallel with file path input.")
Expand Down Expand Up @@ -710,7 +710,7 @@ def _open_pdf(input_data, password, autoclose):
return pdf, to_hold, to_close


# TODO(v5) change outline API (see above)
# TODO(apibreak) change outline API (see above)
PdfOutlineItem = namedtuple("PdfOutlineItem", "level title is_closed n_kids page_index view_mode view_pos")
"""
Bookmark information.
Expand Down

0 comments on commit 065bd1f

Please sign in to comment.