예제 #1
0
    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
예제 #2
0
 def __init__(self, rsf):
     InstrumentResultsFileParser.__init__(self, rsf, 'XLSX')
예제 #3
0
 def __init__(self, rsf):
     InstrumentResultsFileParser.__init__(self, rsf, 'CSV')
예제 #4
0
 def __init__(self, txt, analysiskey, mimetype='text'):
     InstrumentResultsFileParser.__init__(self, txt, mimetype)
     self.analysiskey = analysiskey
     self._mimetype = mimetype
예제 #5
0
 def __init__(self, xml):
     InstrumentResultsFileParser.__init__(self, xml, 'XML')
     self._assays = {}
     self._instruments = {}
예제 #6
0
 def __init__(self, txt, analysiskey, mimetype='text'):
     InstrumentResultsFileParser.__init__(self, txt, mimetype)
     self.analysiskey = analysiskey
     self._mimetype = mimetype