def __parse_tuple(self, line): """ parses a mapi data tuple, and returns a list of python types""" elements = line[1:-1].split(',\t') if len(elements) == len(self.description): return tuple([pythonize.convert(element.strip(), description[1]) for (element, description) in zip(elements, self.description)]) else: self.__exception_handler(InterfaceError, "length of row doesn't match header")
def convert(self, data, type_code): """ use a type_code defined in monetdb.sql.types """ return pythonize.convert(data, type_code)