Use is None instead of == None

This commit is contained in:
Benjamin Loison 2023-09-14 20:18:51 +02:00
parent 9c3ed9dd2a
commit 6f97554195
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -46,7 +46,7 @@ for folder in os.listdir():
for line in lines: for line in lines:
if not started: if not started:
# We are interested in the content after this line: # We are interested in the content after this line:
if soldeCrediteurAuRegex.match(line) != None or (line.startswith('Date Nature des opérations Valeur Débit Crédit') and not firstPage): if soldeCrediteurAuRegex.match(line) is not None or (line.startswith('Date Nature des opérations Valeur Débit Crédit') and not firstPage):
if soldeCrediteurAuRegex.match(line): if soldeCrediteurAuRegex.match(line):
initialAmount = float(soldeCrediteurAuRegex.sub('', line).replace(',', '.').replace(' ', '')) initialAmount = float(soldeCrediteurAuRegex.sub('', line).replace(',', '.').replace(' ', ''))
currentAmount = initialAmount currentAmount = initialAmount
@ -56,15 +56,15 @@ for folder in os.listdir():
continue continue
else: else:
# We aren't interested in the content after this line: # We aren't interested in the content after this line:
if line.startswith('BNP PARIBAS SA au capital de') or endPageAfterTheFirstOneRegex.match(line) != None: if line.startswith('BNP PARIBAS SA au capital de') or endPageAfterTheFirstOneRegex.match(line) is not None:
firstPage = False firstPage = False
started = False started = False
continue continue
# We aren't interested in the content after this line # We aren't interested in the content after this line
elif line.startswith('TOTAL DES OPERATIONS'): elif line.startswith('TOTAL DES OPERATIONS'):
break break
if firstLineOfPaymentRegex.match(line) != None: if firstLineOfPaymentRegex.match(line) is not None:
if date != None: if date is not None:
print(date, valeur, amount, currentAmount) print(date, valeur, amount, currentAmount)
print('\n'.join(comment)) print('\n'.join(comment))
print() print()