-
Notifications
You must be signed in to change notification settings - Fork 5
Description
| def unzip_if_needed(self, owner_id: UserIDT) -> str: |
If UserDirectory(owner_id) does not contain the file, it is assumed that it is in CommonFolder(self.config.common_folder()).
This leads to the later error message: No object to import.<br>* No .txt or .tsv file was found, of which name starts with 'ecotaxa'. It is not obvious from that message that the supplied path was wrong.
It would be better to validate the path early on.
Also, UserDirectory.contains is a coarse heuristic. Furthermore, this would be the place to fix #56 and #60:
I would let UserDirectory and CommonFolder calculate the absolute path of the supplied filename and check which of both exists (and is below the user or common directory). The only remaining problem would be that a name could exist in both directories, so that the choice is ambiguous.