Coverage for control/typ/cust/country.py : 90%

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
7CW = C.web
9Qq = H.icon(CW.unknown[N.generic], asChar=True)
10Qc = H.icon(CW.unknown[N.country], asChar=True)
13class Country(Value):
14 """Type class for countries."""
16 def __init__(self, context):
17 super().__init__(context)
19 def titleStr(self, record, markup=True, **kwargs):
20 """Puts the 2-letter iso code plus the flag characters in the title."""
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
26 iso = H.he(valBare)
27 return iso + shiftRegional(iso) if iso else Qc
29 def titleHint(self, record):
30 """Provides the full country name as a tooltip on the interface."""
32 return G(record, N.name) or Qc