Closed Amerlander closed 3 years ago
Is there a good reason to have the hex file in zip archives in the first place?
Why not placing directly the hex files in the main directory? When processed, the hex files are renamed to .hex.done
instead of the zip archives.
This way, we get rid of at least to problems:
Maybe, falling back to processing hex files directly can be implemented in a later version.
I think this depends on how the process of receiving Code from the students and sending it to the Pi will look like. We should discuss this together with @joernalraun on Thursday.
At the moment the script only handle .hex files who are directly zipped. If it happens that someone Zips a complete Folder the unpacked run_ folder will contain a subfolder where the .hex files are (`.zip/folder/file.hex`). These hex files wont be processed.
Unzip has a
-j
option to do not create subdirectories:unzip -j /path/to/file.zip
. I'm not aware ifshutil.unpack_archive()
can do something similar.But having multiple folders like
*.zip/folder1/file1.hex
*.zip/folder2/file1.hex
might result in ending with only one hex file instead of two. So It could also be an option to just cancel the process if the zip file contains one (or more than one) subfolder und report an error?
It could also be, that someone