Coverage for view / output_format.py: 100.00%

14 statements  

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

1from enum import Enum 

2 

3 

4class OutputFormat(Enum): 

5 PLAIN_TEXT = "txt" 

6 MARKDOWN = "md" 

7 JSON = "json" 

8 

9 @property 

10 def extension(self) -> str: 

11 return f".{self.value}" 

12 

13 @property 

14 def display_name(self) -> str: 

15 return { 

16 OutputFormat.PLAIN_TEXT: "plain text", 

17 OutputFormat.MARKDOWN: "markdown", 

18 OutputFormat.JSON: "json" 

19 }[self] 

20 

21 @property 

22 def display_hint(self) -> str: 

23 return f"({self.extension})"