-
Notifications
You must be signed in to change notification settings - Fork 91
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
Intercept webbrowser
open requests for local html files as well as localhost
#4178
Conversation
You could use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this works locally, nice!
-
I agree with Isabel's recommendation for
urlparse
. -
Could you also please update the
test_viewer_webbrowser_does_not_open
unit test to include this case? (Maybe the test should be renamed as well.) -
TODO: Figure out if the file being displayed is a plot or not.
Any ideas for how to determine this?
…splay an html file and if so, use the new `show-html-file` comm to display in viewer pane.
…urllib.parse` module
c5f77c8
to
08670f8
Compare
@seeM , |
@isabelizimm , thanks! Used |
``` | ||
|
||
Run Positron's unit tests with [pytest](https://docs.pytest.org/en/8.0.x/): | ||
|
||
```sh | ||
pytest python_files/positron/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, did pytest not work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was trying to use a different python version than which python
was giving me. Wasim suggested this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was that python -m pytest
should work in all cases where pytest
works, and more. So it'll probably save folks some headaches.
Addresses #4118
Hooks into the new
'show-html-file'
comm path to display html files opened with thewebbrowser
python module in the viewer pane.Previously we overrode the
webbrowser
opening to forward localhost servers, so this just adds a condition to check for html files and do a similar thing.Here's an example of it working on a bokeh plot that previously used to open in an external browser:
Rough edges:
QA Notes