Coverage for sources / ictr / flavors.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-12 01:33 +0000

1# vim: set filetype=python fileencoding=utf-8: 

2# -*- coding: utf-8 -*- 

3 

4#============================================================================# 

5# # 

6# Licensed under the Apache License, Version 2.0 (the "License"); # 

7# you may not use this file except in compliance with the License. # 

8# You may obtain a copy of the License at # 

9# # 

10# http://www.apache.org/licenses/LICENSE-2.0 # 

11# # 

12# Unless required by applicable law or agreed to in writing, software # 

13# distributed under the License is distributed on an "AS IS" BASIS, # 

14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

15# See the License for the specific language governing permissions and # 

16# limitations under the License. # 

17# # 

18#============================================================================# 

19 

20 

21''' Reporter flavors. ''' 

22 

23 

24from . import __ 

25 

26 

27Flavor: __.typx.TypeAlias = int | str 

28 

29 

30class StandardFlavorSpecification( __.immut.DataclassObject ): 

31 ''' Specification for standard flavor. ''' 

32 

33 color: __.typx.Annotated[ 

34 str, __.ddoc.Doc( ''' Name of introduction color. ''' ) ] 

35 emoji: __.typx.Annotated[ str, __.ddoc.Doc( ''' Introduction emoji. ''' ) ] 

36 label: __.typx.Annotated[ str, __.ddoc.Doc( ''' Introduction label. ''' ) ] 

37 stack: __.typx.Annotated[ 

38 bool, __.ddoc.Doc( ''' Include stack trace? ''' ) 

39 ] = False 

40 

41 

42flavor_aliases_standard: __.immut.Dictionary[ 

43 str, str 

44] = __.immut.Dictionary( { 

45 'n': 'note', 'm': 'monition', 

46 'e': 'error', 'a': 'abort', 

47 'ex': 'errorx', 'ax': 'abortx', 

48 'f': 'future', 's': 'success', 

49 'v': 'advice', 

50} ) 

51 

52flavor_specifications_standard: __.immut.Dictionary[ 

53 str, StandardFlavorSpecification 

54] = __.immut.Dictionary( 

55 note = StandardFlavorSpecification( 

56 color = 'blue', 

57 emoji = '\N{Information Source}\ufe0f', 

58 label = 'NOTE' ), 

59 monition = StandardFlavorSpecification( 

60 color = 'yellow', 

61 emoji = '\N{Warning Sign}\ufe0f', 

62 label = 'MONITION' ), 

63 error = StandardFlavorSpecification( 

64 color = 'red', emoji = '❌', label = 'ERROR' ), 

65 errorx = StandardFlavorSpecification( 

66 color = 'red', emoji = '❌', label = 'ERROR', stack = True ), 

67 abort = StandardFlavorSpecification( 

68 color = 'bright_red', emoji = '💥', label = 'ABORT' ), 

69 abortx = StandardFlavorSpecification( 

70 color = 'bright_red', emoji = '💥', label = 'ABORT', stack = True ), 

71 future = StandardFlavorSpecification( 

72 color = 'magenta', emoji = '🔮', label = 'FUTURE' ), 

73 success = StandardFlavorSpecification( 

74 color = 'green', emoji = '✅', label = 'SUCCESS' ), 

75 advice = StandardFlavorSpecification( 

76 color = 'cyan', emoji = '💡', label = 'ADVICE' ), 

77)