kfl / staffeli_nt

Staffeli NT Technology
MIT License
8 stars 8 forks source link

Fix multiple zip-files crashing download.py #53

Closed madsobitsoe closed 2 years ago

madsobitsoe commented 2 years ago

Fixes #52 by adding dynamic name-generation of directories to unpack in and adding more exception-handling.

madsobitsoe commented 2 years ago

I just realized there already is a PR #44 for this issue (although no issue attached to that PR).

My PR is definitely a quick-fix for PoP. Feel free to reject it and ask for a proper solution. The "right behaviour" might be to bail on the submission altogether.

kfl commented 2 years ago

I like that this attempts to do the right thing.

One small request: I think we should warn the user that we are creating multiple unpacked directories when we do that, and tell which zip-file is unpacked in which unpacked directory.

madsobitsoe commented 2 years ago

I agree. We could probably use the filename of the zip we are unpacking as part of the directory-name. E.g. handin.zip -> handin_unpacked unexpected.zip -> unexpected_unpacked

As well as notifying the user that more than one unpacking happened.

I fear that my current implementation might break the OnlineTA-functionality. We (I) should probably look into that before we decide what to do with this PR.