Coverage for src / dotbot / messenger / level.py: 56%

32 statements  

« prev     ^ index     » next       coverage.py v7.12.0, created at 2025-11-29 10:55 -0800

1from enum import Enum 

2from typing import Any 

3 

4 

5class Level(Enum): 

6 NOTSET = 0 

7 DEBUG = 10 

8 INFO = 15 

9 LOWINFO = 15 # Deprecated: use INFO instead # noqa: PIE796 

10 ACTION = 20 

11 WARNING = 30 

12 ERROR = 40 

13 

14 def __lt__(self, other: Any) -> bool: 

15 if not isinstance(other, Level): 

16 return NotImplemented 

17 return self.value < other.value 

18 

19 def __le__(self, other: Any) -> bool: 

20 if not isinstance(other, Level): 

21 return NotImplemented 

22 return self.value <= other.value 

23 

24 def __gt__(self, other: Any) -> bool: 

25 if not isinstance(other, Level): 

26 return NotImplemented 

27 return self.value > other.value 

28 

29 def __ge__(self, other: Any) -> bool: 

30 if not isinstance(other, Level): 

31 return NotImplemented 

32 return self.value >= other.value 

33 

34 def __eq__(self, other: object) -> bool: 

35 if not isinstance(other, Level): 

36 return NotImplemented 

37 return self.value == other.value 

38 

39 def __hash__(self) -> int: 

40 return hash(self.value)