Skip to content

Commit

Permalink
Merge branch 'main' into allow_new_file_types
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer authored Jul 7, 2022
2 parents 94901e7 + 204a004 commit a22e015
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion jupyter_server/extension/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,16 @@ def load_classic_server_extension(cls, serverapp):
)
extension.initialize()

serverapp_class = ServerApp

@classmethod
def make_serverapp(cls, **kwargs):
"""Instantiate the ServerApp
Override to customize the ServerApp before it loads any configuration
"""
return cls.serverapp_class.instance(**kwargs)

@classmethod
def initialize_server(cls, argv=None, load_other_extensions=True, **kwargs):
"""Creates an instance of ServerApp and explicitly sets
Expand All @@ -553,7 +563,7 @@ def initialize_server(cls, argv=None, load_other_extensions=True, **kwargs):
jpserver_extensions.update(cls.serverapp_config["jpserver_extensions"])
cls.serverapp_config["jpserver_extensions"] = jpserver_extensions
find_extensions = False
serverapp = ServerApp.instance(jpserver_extensions=jpserver_extensions, **kwargs)
serverapp = cls.make_serverapp(jpserver_extensions=jpserver_extensions, **kwargs)
serverapp.aliases.update(cls.aliases)
serverapp.initialize(
argv=argv or [],
Expand Down

0 comments on commit a22e015

Please sign in to comment.