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

sigal serve --browser : open in your default browser #516

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

Lucas-C
Copy link
Contributor

@Lucas-C Lucas-C commented Apr 30, 2024

Hi!

First, thank you very much for maintaining this tool.
Thanks yo you, yesterday I was able to very quickly setup a web gallery that perfectly suited my need.

This very short contribution introduces a hand --browser / -b flag to the sigal serve command, that opens the sigal gallery in the user default web brower, using the standard Python module webbrowser.

I did not add a unit test to tests/test_cli.py, because it seemed difficult to me to test the standard behaviour of the webbrowser stanbdard package.
If need be, I can add one that ensure that webbrowser.open() gets called, using a mock.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 88.54%. Comparing base (eea2c56) to head (cf223ce).

Files Patch % Lines
src/sigal/__main__.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- Coverage   88.61%   88.54%   -0.08%     
==========================================
  Files          25       25              
  Lines        2073     2077       +4     
==========================================
+ Hits         1837     1839       +2     
- Misses        236      238       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@saimn saimn merged commit cf15fcc into saimn:main Apr 30, 2024
6 of 8 checks passed
@saimn
Copy link
Owner

saimn commented Apr 30, 2024

Thanks ! I had this idea a long time ago but seems it was forgotten :)
A mock test doesn't seem necessary for 2 lines.

@Lucas-C
Copy link
Contributor Author

Lucas-C commented May 1, 2024

Thanks ! I had this idea a long time ago but seems it was forgotten :) A mock test doesn't seem necessary for 2 lines.

Thanks for accepting my contribution, and for doing so quickly 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants