add name main check

This commit is contained in:
interfisch 2024-07-16 22:36:28 +02:00
parent 64bd6f79f5
commit e31ccb1813
1 changed files with 39 additions and 40 deletions

View File

@ -148,7 +148,9 @@ def delete_file(filename):
exit() exit()
if serialport.isOpen():
if __name__ == "__main__":
if serialport.isOpen():
establish_connection() establish_connection()
@ -159,6 +161,7 @@ if serialport.isOpen():
#Copy all Files #Copy all Files
failed=0 failed=0
for filename in filenames: for filename in filenames:
@ -180,6 +183,7 @@ if serialport.isOpen():
#Delete all files #Delete all files
''' '''
log_off() log_off()
for filename in filenames: for filename in filenames:
@ -187,12 +191,7 @@ if serialport.isOpen():
''' '''
serialport.write("echo on\n".encode())
serialport.close()
serialport.write("echo on\n".encode())
serialport.close()