I need to check if thre is a call for a function, I know it's not a txt file but when I read a line and try to print using type() it's says str and let me to print all the file correctly but for whatever reason the lines can't be compare and I don't know why, when I compile shows no error, the first line of the file is '#include <Arduino.h>' and the var found is false anyways
import os
def BeforeBuild():
found = False
with open(r"\src\OTAWEBAP.cpp", "r") as f:
for line in f:
print (line)
if(line == '#include <Arduino.h>'):
found = True;
if(not found):
raise Exception("OtaIni function not found, you need to use it to preserve OTA functions in your new deploy")
else:
print('function OtaIni was found')
f.close()
BeforeBuild()