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

Allow plugins to hook into File > Open #7794

Open
jitseniesen opened this issue Aug 31, 2018 · 1 comment · May be fixed by #22564
Open

Allow plugins to hook into File > Open #7794

jitseniesen opened this issue Aug 31, 2018 · 1 comment · May be fixed by #22564

Comments

@jitseniesen
Copy link
Member

This is inspired by spyder-ide/spyder-notebook#134. Users of the spyder-notebook plugin expect to open a notebook using File > Open. At the moment, this causes the notebook to be opened in the editor, which is not so useful. Somehow the notebook plugin (or any other plugin) should be able to indicate that it should be used to open files of a particular type.

Maybe the plugin initialization code should include a call like:

register_file_extension('.ipynb')

When the user opens a file with that extension, Spyder calls the plugin's load() function, similar to Editor.load().

@ccordoba12
Copy link
Member

Some comments about this:

  1. I agree with the register_file_extension name.
  2. This needs to go to to the spyder.api module.
  3. You need to modify the method called open_file from app/mainwindow.py, present here (for now).

@ccordoba12 ccordoba12 modified the milestones: v4.0beta2, v4.0beta3 Oct 12, 2018
@ccordoba12 ccordoba12 modified the milestones: v4.0beta3, v4.0beta4 May 18, 2019
@ccordoba12 ccordoba12 modified the milestones: v4.0rc, future Sep 17, 2019
@goanpeca goanpeca removed this from the future milestone Feb 23, 2020
@jitseniesen jitseniesen removed their assignment Jul 7, 2023
@ccordoba12 ccordoba12 linked a pull request Sep 25, 2024 that will close this issue
@ccordoba12 ccordoba12 added this to the v6.1.0 milestone Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment