Coverage for fpdf2_textindex / constants.py: 100.00%

26 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-24 15:45 +0000

1"""Constants.""" 

2 

3import logging 

4from typing import Final, Literal 

5 

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

7 

8# ID prefix/suffix 

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

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

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

12 

13# Directives 

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

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

16 

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

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

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

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

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

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

23 

24# Output 

25REFERENCES_LIMIT: Final[int] = 10 

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

27 

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

29"""Category separator.""" 

30 

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

32"""Field separator.""" 

33 

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

35"""List separator.""" 

36 

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

38"""Path separator.""" 

39 

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

41"""Range separator."""