def _keydecoder(self, keybytes): fieldid = unpack_ushort(keybytes[:_SHORT_SIZE])[0] return self._fieldunmap[fieldid], keybytes[_SHORT_SIZE:]
def get_ushort(self, position): return unpack_ushort(self.map[position:position + _SHORT_SIZE])[0]
def keydecoder(self, v): assert isinstance(v, bytes_type) return (self.names[unpack_ushort(v[:2])[0]], utf8decode(v[2:])[0])
def keydecoder(self, v): return (self.names[unpack_ushort(v[:2])[0]], utf8decode(v[2:])[0])
def read_ushort(self): return unpack_ushort(self.file.read(_SHORT_SIZE))[0]
def keydecoder(self, v): if isinstance(v, text_type): v = v.encode('latin-1') return (self.names[unpack_ushort(v[:2])[0]], utf8decode(v[2:])[0])
def get_ushort(self, position): return unpack_ushort(self.get(position, _SHORT_SIZE))[0]