def name(self): """ The name of this atom as unicode string. """ return ensure_unicode_string(xlib.get_atom_name(self.display, self))
def test_ensure_unicode_string(): assert isinstance(util.ensure_unicode_string(b'foo'), unicode) assert util.ensure_unicode_string(b'foo') == 'foo' s = 'foo' assert util.ensure_unicode_string(s) is s
def name(self): """ The name of this atom as unicode string. """ return ensure_unicode_string(xlib.get_atom_name(self.display, self))
def name(self): """ The name of this device as unicode string. """ with self._query_device() as device: return ensure_unicode_string(device.contents.name)
def name(self): """ The name of this device as unicode string. """ with self._query_device() as device: return ensure_unicode_string(device.contents.name)