Skip to content

Commit

Permalink
add can_be_root and may_contain_root_candidates to citation addon ite…
Browse files Browse the repository at this point in the history
…m results
  • Loading branch information
adlius committed Dec 9, 2024
1 parent 8581838 commit f50bd1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions addon_toolkit/interfaces/citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,17 @@ class ItemResult:
item_name: str
item_type: ItemType
item_path: list[str] | None = None
can_be_root: bool = None
may_contain_root_candidates: bool = None
csl: dict | None = None

def __post_init__(self):
"""By default can_be_root and may_contain_root_candidates are bound to item_type"""
if self.can_be_root is None:
self.can_be_root = self.item_type == ItemType.COLLECTION
if self.may_contain_root_candidates is None:
self.may_contain_root_candidates = self.item_type == ItemType.COLLECTION


@dataclasses.dataclass(slots=True)
class ItemSampleResult:
Expand Down

0 comments on commit f50bd1b

Please sign in to comment.