mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-03 03:13:25 +02:00
Check eyecatch validation
To prevent configuration file corruption
This commit is contained in:
@@ -148,7 +148,7 @@ def changeConfig(src, enabled, disabled):
|
|||||||
# in the defines block to modify
|
# in the defines block to modify
|
||||||
if regend.match(line):
|
if regend.match(line):
|
||||||
# end of block found
|
# end of block found
|
||||||
state = 0
|
state = 2
|
||||||
dst += line
|
dst += line
|
||||||
else:
|
else:
|
||||||
dstLine = ""
|
dstLine = ""
|
||||||
@@ -172,6 +172,11 @@ def changeConfig(src, enabled, disabled):
|
|||||||
else:
|
else:
|
||||||
dst += line
|
dst += line
|
||||||
print(line.rstrip())
|
print(line.rstrip())
|
||||||
|
elif state == 2:
|
||||||
|
dst += line
|
||||||
|
if state != 2:
|
||||||
|
print("EYECATCH pair not found. Cancel changes.")
|
||||||
|
sys.exit(255)
|
||||||
return dst
|
return dst
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Reference in New Issue
Block a user