Coverage for fpdf2_textindex/constants.py: 100.00%

27 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-01 14:22 +0000

1"""Constants.""" 

2 

3import logging 

4from typing import Final, Literal 

5 

6LOGGER: logging.Logger = logging.getLogger(__name__.rsplit(".", maxsplit=1)[0]) 

7 

8 

9# ID prefix/suffix 

10ENTRY_ID_PREFIX: Final[Literal["ent"]] = "ent" 

11INDEX_ID_PREFIX: Final[Literal["idx"]] = "idx" 

12TEXT_ID_SUFFIX: Final[Literal["t"]] = "t" # from index to text 

13 

14# Directives 

15PATH_DELIMITER: Final[Literal[">"]] = ">" 

16REFS_DELIMITER: Final[Literal[";"]] = ";" 

17 

18ALSO_MARKER: Final[Literal["+"]] = "+" 

19CLOSING_MARKER: Final[Literal["/"]] = "/" 

20DISABLE_MARKER: Final[Literal["-"]] = "-" 

21EMPHASIS_MARKER: Final[Literal["!"]] = "!" 

22ENABLE_MARKER: Final[Literal["+"]] = "+" 

23INBOUND_MARKER: Final[Literal["@"]] = "@" 

24 

25# Output 

26REFERENCES_LIMIT: Final[int] = 10 

27"""The limit of references per entry before a warning is shown.""" 

28 

29CATEGORY_SEPARATOR: Final[Literal[". "]] = ". " 

30"""Category separator.""" 

31 

32FIELD_SEPARATOR: Final[Literal[", "]] = ", " 

33"""Field separator.""" 

34 

35LIST_SEPARATOR: Final[Literal["; "]] = "; " 

36"""List separator.""" 

37 

38PATH_SEPARATOR: Final[Literal[": "]] = ": " 

39"""Path separator.""" 

40 

41RANGE_SEPARATOR: Final[Literal["–"]] = "–" # noqa: RUF001 

42"""Range separator.""" 

43 

44# Last sort label 

45_LAST_SORT_LABEL: Final[Literal["\uffff"]] = "\uffff"