refactor: Rename annotation content variables

Renamed the two variables describing an annotation's highlighted PDF-text and
its appended note if any exists. Previously called 'text' (for the in-PDF
highlighted content) and 'content' (for the additional supplied content).

Now they are called 'content' for the IN PDF words, highlighted.
and 'note' for the appended note given (or not) in an annotation.
This commit is contained in:
Marty Oehme 2024-01-23 09:54:36 +01:00
parent 9169e1c98a
commit 11d570f9d8
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 5 additions and 5 deletions

View file

@ -28,9 +28,9 @@ class Annotation:
file: str file: str
colors: tuple[float, float, float] = field(default_factory=lambda: (0.0, 0.0, 0.0)) colors: tuple[float, float, float] = field(default_factory=lambda: (0.0, 0.0, 0.0))
content: str = "" content: str = ""
note: str = ""
page: int = 0 page: int = 0
tag: str = "" tag: str = ""
text: str = ""
type: str = "Highlight" type: str = "Highlight"
minimum_similarity_color: float = 1.0 minimum_similarity_color: float = 1.0
@ -43,8 +43,8 @@ class Annotation:
""" """
data = { data = {
"file": self.file, "file": self.file,
"quote": self.text, "quote": self.content,
"note": self.content, "note": self.note,
"page": self.page, "page": self.page,
"tag": self.tag, "tag": self.tag,
"type": self.type, "type": self.type,

View file

@ -41,8 +41,8 @@ class PdfExtractor:
) )
a = Annotation( a = Annotation(
file=str(filename), file=str(filename),
text=quote or "", content=quote or "",
content=note or "", note=note or "",
colors=col, colors=col,
type=annot.type[1], type=annot.type[1],
page=(page.number or 0) + 1, page=(page.number or 0) + 1,