Skip to content
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

File widget : Accept any file #6792

Open
alaindebecker opened this issue Apr 26, 2024 · 3 comments · May be fixed by #6894
Open

File widget : Accept any file #6792

alaindebecker opened this issue Apr 26, 2024 · 3 comments · May be fixed by #6894
Labels
meal This will take a day or two

Comments

@alaindebecker
Copy link

What's wrong?
I have files named something.metar but the file widget only accept certain file names.

How can we reproduce the problem?
Open the widget and look to the drop down list of accepted file names : you won't find the All files (*.*) as usual.

** NOTE **
Can somebody checks if the problem is Windows only, please.

What's your environment?

  • Operating system: Windows
  • Orange version: 3.32.6
  • How you installed Orange: pip
@alaindebecker alaindebecker added the bug report Bug is reported by user, not yet confirmed by the core team label Apr 26, 2024
@markotoplak
Copy link
Member

I like this suggestion now that the widget has an explicit file type selector.

@janezd janezd added meal This will take a day or two and removed bug report Bug is reported by user, not yet confirmed by the core team labels May 10, 2024
@janezd
Copy link
Contributor

janezd commented Sep 15, 2024

@markotoplak, I've started working on this and I have a few questions related to the current implementation.

  • Why is the reader choice not a setting?
  • Related to this, the combo goes back to auto-detect when the user chooses a different file. This may be annoying (and unexpected) for somebody who is reading multiple files with non-standard extension. I suppose the combo must not change behind the user's back.
  • Why is it disabled for URLs? Is there a deeper reason or is it just because it uses a different code for reading, and implementing manual format selection would require rewriting it.
  • If we keep it disabled, why wouldn't we move it below the File option (above the URL)?

The File widget's code is indeed one big mess. (And I confess to not only contributing to it but perhaps even establishing it in the first place.) It could be one's big project to reimplement if from scratch, or, better, based on (and merging it with) the CSV widget.

@markotoplak
Copy link
Member

* Why is the reader choice not a setting?

It is stored as a part of the RecentPath object so it is stored in there.

* Related to this, the combo goes back to auto-detect when the user chooses a different file. This may be annoying (and unexpected) for somebody who is reading multiple files with non-standard extension. I suppose the combo must not change behind the user's back.

I probably stored the reader into RecentPath because changing the file in the selector then also changed the reader. But I do agree with you: choosing a completely new file should in fact use the same reader as is currently selected.

* Why is it disabled for URLs? Is there a deeper reason or is it just because it uses a different code for reading, and implementing manual format selection would require rewriting it.

I did not look into that part at all. In the end, the code uses the same readers but goes through different paths. Or maybe how I implemented the settings into a RecentPath was the problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meal This will take a day or two
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants