def __init__(self, infile, worksheet, encoding='xlsx'): InstrumentResultsFileParser.__init__(self, infile, encoding.upper()) # Convert xls to csv self._delimiter = "|" if encoding == 'xlsx': csv_data = xlsx_to_csv(infile, worksheet=worksheet, delimiter=self._delimiter) elif encoding == 'xls': csv_data = xls_to_csv(infile, worksheet=worksheet, delimiter=self._delimiter) # adpat csv_data into a FileUpload for parse method self._infile = infile stub = FileStub(file=csv_data, name=str(infile.filename)) self._csvfile = FileUpload(stub) self._encoding = encoding self._end_header = False
def __init__(self, rsf): InstrumentResultsFileParser.__init__(self, rsf, 'XLSX')
def __init__(self, rsf): InstrumentResultsFileParser.__init__(self, rsf, 'CSV')
def __init__(self, txt, analysiskey, mimetype='text'): InstrumentResultsFileParser.__init__(self, txt, mimetype) self.analysiskey = analysiskey self._mimetype = mimetype
def __init__(self, xml): InstrumentResultsFileParser.__init__(self, xml, 'XML') self._assays = {} self._instruments = {}