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.utils import pick as G, E, shiftRegional 

3from control.html import HtmlElements as H 

4from control.typ.value import Value 

5 

6 

7CW = C.web 

8 

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

10Qc = H.icon(CW.unknown[N.country], asChar=True) 

11 

12 

13class Country(Value): 

14 """Type class for countries.""" 

15 

16 def __init__(self, context): 

17 super().__init__(context) 

18 

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

20 """Puts the 2-letter iso code plus the flag characters in the title.""" 

21 

22 valBare = G(record, N.iso) 

23 if markup is None: 23 ↛ 24line 23 didn't jump to line 24, because the condition on line 23 was never true

24 return valBare or E 

25 

26 iso = H.he(valBare) 

27 return iso + shiftRegional(iso) if iso else Qc 

28 

29 def titleHint(self, record): 

30 """Provides the full country name as a tooltip on the interface.""" 

31 

32 return G(record, N.name) or Qc