Code Duplication    Length = 10-11 lines in 2 locations

bika/lims/exportimport/instruments/agilent/masshunter/masshunter.py 1 location

@@ 137-147 (lines=11) @@
134
135
        # Analysis Time	7/13/2017 9:55
136
        if splitted[0] == self.HEADERKEY_ANALYSISTIME:
137
            if splitted[1]:
138
                try:
139
                    d = datetime.strptime(splitted[1], "%m/%d/%Y %H:%M")
140
                    self._header[self.HEADERKEY_ANALYSISTIME] = d
141
                except ValueError:
142
                    self.err("Invalid Output Time format",
143
                             numline=self._numline, line=line)
144
            else:
145
                self.warn("Output Time not found or empty",
146
                          numline=self._numline, line=line)
147
                d = datetime.strptime(splitted[1], "%I:%M %p")
148
149
        # Analyst Name	MassHunter01\Agilent
150
        elif splitted[0] == self.HEADERKEY_ANALYSTNAME:

bika/lims/exportimport/instruments/agilent/masshunter/quantitative.py 1 location

@@ 196-205 (lines=10) @@
193
194
        # Analysis Time,3/20/2013 7:11 AM,Analyst Name,Administrator,,,,,,,,,,,,,,
195
        elif splitted[0] == self.HEADERKEY_ANALYSISTIME:
196
            if splitted[1]:
197
                try:
198
                    d = datetime.strptime(splitted[1], "%m/%d/%Y %I:%M %p")
199
                    self._header[self.HEADERKEY_ANALYSISTIME] = d
200
                except ValueError:
201
                    self.err("Invalid Analysis Time format",
202
                             numline=self._numline, line=line)
203
            else:
204
                self.warn("Analysis Time not found or empty",
205
                          numline=self._numline, line=line)
206
207
            if splitted[2] and splitted[2] == self.HEADERKEY_ANALYSTNAME:
208
                if splitted[3]: