-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement configuration of exhibits via traitlets (#8)
* [WiP] Implement configuration of exhibits via traitlets * Rename, add docs, add title as configurable
- Loading branch information
1 parent
8118bd4
commit 4d009c2
Showing
12 changed files
with
285 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from jupyter_server.extension.application import ExtensionApp | ||
from .handlers import ExhibitsHandler, GalleryHandler, PullHandler | ||
from .manager import GalleryManager | ||
|
||
|
||
class GalleryApp(ExtensionApp): | ||
name = "gallery" | ||
|
||
handlers = [ | ||
("jupyterlab-gallery/gallery", GalleryHandler), | ||
("jupyterlab-gallery/exhibits", ExhibitsHandler), | ||
("jupyterlab-gallery/pull", PullHandler), | ||
] | ||
|
||
# default_url = "/jupyterlab-gallery" | ||
# load_other_extensions = True | ||
# file_url_prefix = "/gallery" | ||
|
||
def initialize_settings(self): | ||
self.log.info("Configured gallery manager") | ||
gallery_manager = GalleryManager( | ||
log=self.log, root_dir=self.serverapp.root_dir, config=self.config | ||
) | ||
self.settings.update({"gallery_manager": gallery_manager}) | ||
|
||
def initialize_handlers(self): | ||
# setting nbapp is needed for nbgitpuller | ||
self.serverapp.web_app.settings["nbapp"] = self.serverapp | ||
|
||
self.log.info(f"Registered {self.name} server extension") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.