def decode_cellarea(value, codec=None): """ Decode a byte sequence representing a cell area into a four-tuple of a Radio integer enum and three integers. If ``codec='base64'``, decode the value from a base64 sequence first. """ if codec == 'base64': value = base64.b64decode(value) radio, mcc, mnc, lac = CELLAREA_STRUCT.unpack(value) return (Radio(radio), mcc, mnc, lac)
def decode_cellid(value, codec=None): """ Decode a byte sequence representing a cell id into a five-tuple of a Radio integer enum and four integers. If ``codec='base64'``, decode the value from a base64 sequence first. """ if codec == 'base64': value = base64.b64decode(value) radio, mcc, mnc, lac, cid = CELLID_STRUCT.unpack(value) return (Radio(radio), mcc, mnc, lac, cid)
def process_result_value(self, value, dialect): if value is None: # pragma: no cover return None radio, mcc, mnc, lac, cid = CELLID_STRUCT.unpack(value) return (Radio(radio), mcc, mnc, lac, cid)
def process_result_value(self, value, dialect): if value is None: return None radio, mcc, mnc, lac = CELLAREA_STRUCT.unpack(value) return (Radio(radio), mcc, mnc, lac)