-
Notifications
You must be signed in to change notification settings - Fork 1.3k
live: Call webbrowser.open #6913
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
Conversation
Use `funcy.once_per_args` decorator to prevent opening the html multiple times if user closes first time. Closes treeverse/dvclive#180
| url = index_path.as_uri() | ||
|
|
||
| if "Microsoft" in uname().release: | ||
| url = Path(index_path) / "index.html" | ||
|
|
||
| webbrowser_open(url) |
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.
Could you please move this piece to ui? Maybe as ui.launch (similar to click.launch) or ui.open_browser? We can handle all relpath, uri and WSL stuff inside it. What do you think?
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.
Sounds good. Will do
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.
Opened #6993
karajan1001
left a comment
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.
LGTM
|
|
||
| def test_dvc_generates_html_during_run(tmp_dir, dvc, mocker, live_stage): | ||
| show_spy = mocker.spy(dvc.live, "show") | ||
| webbrowser_open = mocker.patch("dvc.repo.live.webbrowser_open") |
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.
@daavoo, it seems that the above change affected all of the tests and now opens the browser while running the tests.
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Closes treeverse/dvclive#180