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:
if not started:
# 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):
initialAmount = float(soldeCrediteurAuRegex.sub('', line).replace(',', '.').replace(' ', ''))
currentAmount = initialAmount
@ -56,15 +56,15 @@ for folder in os.listdir():
continue
else:
# 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
started = False
continue
# We aren't interested in the content after this line
elif line.startswith('TOTAL DES OPERATIONS'):
break
if firstLineOfPaymentRegex.match(line) != None:
if date != None:
if firstLineOfPaymentRegex.match(line) is not None:
if date is not None:
print(date, valeur, amount, currentAmount)
print('\n'.join(comment))
print()