Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from config import Config as C, Names as N 

2from control.html import HtmlElements as H 

3from control.utils import pick as G, E 

4from control.typ.value import Value 

5 

6CW = C.web 

7 

8Qq = H.icon(CW.unknown[N.generic], asChar=True) 

9 

10 

11class Score(Value): 

12 """Type class for scores.""" 

13 

14 def __init__(self, context): 

15 super().__init__(context) 

16 

17 def titleStr(self, record, markup=True): 

18 """Put the score and the level in the title.""" 

19 

20 score = G(record, N.score) 

21 if score is None: 

22 return E if markup is None else Qq 

23 

24 levelBare = G(record, N.level) 

25 return ( 

26 f"""{score or E} - {levelBare or E}""" 

27 if markup is None 

28 else f"""{H.he(score)} - {H.he(levelBare) or Qq}""" 

29 )