1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-02 10:53:01 +02:00

Check eyecatch validation

To prevent configuration file corruption
This commit is contained in:
odaki
2020-03-23 21:03:33 +09:00
parent f0069bbea9
commit 043b820181

View File

@@ -148,7 +148,7 @@ def changeConfig(src, enabled, disabled):
# in the defines block to modify
if regend.match(line):
# end of block found
state = 0
state = 2
dst += line
else:
dstLine = ""
@@ -172,6 +172,11 @@ def changeConfig(src, enabled, disabled):
else:
dst += line
print(line.rstrip())
elif state == 2:
dst += line
if state != 2:
print("EYECATCH pair not found. Cancel changes.")
sys.exit(255)
return dst
def main():