Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CgmesImporter, allow importing with wrong dataextension when the main…
…file doesn't exist This happens when filenames have the 2 following properties: - the filename contains a dot: - the filename does not contain the dataextension For example this filename triggers the bug: "microgrid.v2.complete.zip" but these work: "microgrid_v2_complete.zip" (because empty dataextension) or "microgrid.v2.complete.xml.zip" (because ".xml" dataextension) The problem is that the main extension is derived as ".v2.complete" but the cgmes importer only accepts an empty dataextension or ".xml" (it checks the dataextension to avoid importing as cgmes from a datasource that was meant by the user to be used as another format). But for now no other importer works without a main file, so when the mainfile doesn't exist so we shouldn't block the import just like when the dataextension is not specified NOTE: this happens because we want to allow archive filenames to be very flexible (with or without the dataextension, and for cgmes even with a totally different basename as what is inside). NOTE: if we ever have another importer that works like the cgmes importer, this means we will not be able to handle the following case: archive/network_EQ.xml archive/network_TP.xml # cgmes files archive/network_foo.other archive/network_bar.other # some new importer format and be able to import from a single directory containing both networks by specifying the dataextension. But this should be a rare case, and moving the data to separate directories or using separate basenames works around the problem.
- Loading branch information