Skip to content

Commit

Permalink
Clean up comparison to False (E712) (senaite#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
winniehell committed Jul 29, 2022
1 parent 90f68aa commit 825e8c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ def __init__(self, csv):

def _parseline(self, line):
# Process the line differenly if it pertains at header or results block
if self._end_header == False:
if self._end_header:
return self.parse_resultline(line)
else:
sline = line.strip(',')
return self.parse_headerline(sline)
else:
return self.parse_resultline(line)

def splitLine(self, line):
# If pertains at header it split the line by ':' and then remove ','
# Else split by ',' and remove blank spaces
if self._end_header == False:
if not self._end_header:
sline = line.split(':')
return [token.strip(',') for token in sline]

Expand Down Expand Up @@ -184,11 +184,11 @@ def __init__(self, csv):

def _parseline(self, line):
# Process the line differenly if it pertains at header or results block
if self._end_header == False:
if self._end_header:
return self.parse_resultline(line)
else:
sline = line.strip(',')
return self.parse_headerline(sline)
else:
return self.parse_resultline(line)

def csvDate2BikaDate(self,DateTime):
#11/03/2014 14:46:46 --> %d/%m/%Y %H:%M %p
Expand All @@ -198,7 +198,7 @@ def csvDate2BikaDate(self,DateTime):
def splitLine(self, line):
# If pertains at header it split the line by ':' and then remove ','
# Else split by ',' and remove blank spaces
if self._end_header == False:
if not self._end_header:
sline = line.split(':')
return [token.strip(',') for token in sline]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def __init__(self, tsv):

def _parseline(self, line):
sline = line.replace('"', '').strip()
if self._end_header == False:
return self.parse_headerline(sline)
else:
if self._end_header:
return self.parse_resultline(sline)
else:
return self.parse_headerline(sline)

def splitLine(self, line):
return [token.strip() for token in line.split('\t')]
Expand Down

0 comments on commit 825e8c9

Please sign in to comment.