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

Use extensionapp open_browser trait for serverapp config #217

Merged
merged 3 commits into from
May 6, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion jupyter_server/extension/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Unicode,
List,
Dict,
Bool,
default,
validate
)
Expand Down Expand Up @@ -205,6 +206,14 @@ def static_url_prefix(self):
help=_("""Handlers appended to the server.""")
).tag(config=True)

open_browser = Bool(False,
help=_("""Whether to open in a browser after starting.
The specific browser used is platform dependent and
determined by the python standard library `webbrowser`
module, unless it is overridden using the --browser
(ServerApp.browser) configuration option.
""")).tag(config=True)

def _config_file_name_default(self):
"""The default config file name."""
if not self.extension_name:
Expand Down Expand Up @@ -311,7 +320,7 @@ def initialize_server(cls, argv=[], load_other_extensions=True, **kwargs):
config = Config({
"ServerApp": {
"jpserver_extensions": {cls.extension_name: True},
"open_browser": True,
"open_browser": cls.open_browser,
"default_url": cls.extension_url
}
})
Expand Down