-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix export ffilter and extensions #184
Conversation
Related to your issue @Qdelannoy |
Thanks @gdolle! Let me unwrap the various issues:
Why is this still necessary? I think this was fixed by #177.
OK thanks, this makes sense. There's just a PEP8 warning about a missing space after the comma.
Can you point me to the code that is relevant to this issue? What exactly does this address (i.e. I do not understand what you mean by "files should now be listed in import/export dialog")?
This is tricky. First, a dot is always seen as a marker to separate the file name from an extension - can you give me a use case where it would make sense to have dots that should not be interpreted as a separator? Second, here's how I think MNELAB should handle data export. Users explicitly select a file type that they want to export. They can enter a file name, and if the extension matches the selected file extension, this just works. However, if the extension does not match, MNELAB should just prepend the correct extension. For example, let's assume we select the ".FIF.GZ" export. If we use the name I'm not even sure if this makes sense. Wouldn't it be easier if users were not allowed to include extensions and MNELAB always appends it? This means that users would not be allowed to type dots (e.g. MNELAB could strip everything after the first dot and use the preceding characters for the file name). WDYT? |
Hi @cbrnr
It is linked to third point changes (I should have say "related" rather than "fix").
Ok I didn't see this warn, I will check
dc56f3c#diff-975205fb7e7c214f502926a07cc973e12f868b5e81d815bb0a41bd9263980980L135
Yes it is. I personally don't use dot in file names, but @Qdelannoy. It's not a good practice to use dot in filename, but it's tolerated in most operating system and there will certainly be "one" user who will use it (=> the current behavior is a GUI crash).
This PR treats the case where the user write the extension, there should not be "double" extension.
I thought about that, but if the user put "test.fif", it means he wish to overwrite test.fif (with confirm dialog) and not create a "test.fif.fif" as you said in previous comment. |
I see, so the problem is that the filter is currently Regarding extensions, here's how Word handles it: In the Save dialog, you can select a file type (with corresponding extension), e.g. "Word Document (.docx)". Then you can type a file name:
I think this is a good approach and MNELAB could also do it like this. This seems to be implemented when I export to FIF and type But when I select "Use .fif", the file is called In any case, your changes look good, but I don't have much time currently, so I apologize if I will take a bit longer to review and merge. |
Yes If I understand you want a specific confirmation for the case the user set a wrong extension. I agree that it would be better. Maybe this suggestion could be rather part of the export refactor #178 as a further changes rather than this current fix. What do you think ? |
Yes, I agree that #178 should take care of such things, and a quick workaround now is better than not being able to export. Like I said, I will need some time to review this. |
@gdolle please add a changelog entry and this is ready to be merged. |
Thanks @gdolle! |
This PR fix issues #183 #176
NB: This just fix export issues but isn't an export refactoring for #178