Coverage for ramose / documentation.py: 93%

14 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-07-01 13:49 +0000

1# SPDX-FileCopyrightText: 2018-2021 Silvio Peroni <silvio.peroni@unibo.it> 

2# SPDX-FileCopyrightText: 2020-2021 Marilena Daquino <marilena.daquino2@unibo.it> 

3# SPDX-FileCopyrightText: 2022 Davide Brembilla 

4# SPDX-FileCopyrightText: 2024 Ivan Heibi <ivan.heibi2@unibo.it> 

5# SPDX-FileCopyrightText: 2025 Sergei Slinkin 

6# SPDX-FileCopyrightText: 2026 Arcangelo Massari <arcangelo.massari@unibo.it> 

7# 

8# SPDX-License-Identifier: ISC 

9 

10from __future__ import annotations 

11 

12from abc import abstractmethod 

13from typing import TYPE_CHECKING 

14 

15if TYPE_CHECKING: 

16 from ramose.api_manager import APIManager 

17 

18 

19class DocumentationHandler: 

20 def __init__(self, api_manager: APIManager) -> None: 

21 """This class provides the main structure for returning a human-readable documentation of all 

22 the operations described in the configuration files handled by the APIManager specified as input.""" 

23 self.conf_doc = api_manager.all_conf 

24 

25 @abstractmethod 

26 def get_documentation(self, *args: str | None, **dargs: str | None) -> tuple[int, str]: 

27 """An abstract method that returns a string defining the human-readable documentation of the operations 

28 available in the input APIManager.""" 

29 # pragma: no cover 

30 

31 @abstractmethod 

32 def store_documentation(self, file_path: str, *args: str | None, **dargs: str | None) -> None: 

33 """An abstract method that store in the input file path (parameter 'file_path') the human-readable 

34 documentation of the operations available in the input APIManager.""" 

35 # pragma: no cover 

36 

37 @abstractmethod 

38 def get_index(self, *args: str | None, **dargs: str | None) -> str: 

39 """An abstract method that returns a string defining the index of all the various configuration files 

40 handled by the input APIManager.""" 

41 # pragma: no cover