Skip to content

Commit

Permalink
Merge pull request #217 from datalayer-contrib/ext-open-browser
Browse files Browse the repository at this point in the history
Use extensionapp open_browser trait for serverapp config
  • Loading branch information
Zsailer authored May 6, 2020
2 parents 6d909ca + 6253c77 commit 15dd628
Showing 1 changed file with 10 additions and 1 deletion.
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(True,
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

0 comments on commit 15dd628

Please sign in to comment.