def _resolve_capability(self, atom):
"""Return a terminal code for a capname or a sugary name, or an empty
Unicode.
The return value is always Unicode, because otherwise it is clumsy
(especially in Python 3) to concatenate with real (Unicode) strings.
"""
code = tigetstr(self._sugar.get(atom, atom))
if code:
# See the comment in ParametrizingString for why this is latin1.
return code.decode('latin1')
return ''
评论列表
文章目录