Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Commit 7a8a8c6

Browse files
committed
include more comments
1 parent aaa827a commit 7a8a8c6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

bookstore/archive.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class BookstoreContentsArchiver(FileContentsManager):
2828

2929
def __init__(self, *args, **kwargs):
3030
super(FileContentsManager, self).__init__(*args, **kwargs)
31+
# opt ourselves into being part of the Jupyter App that should have Bookstore Settings applied
3132
self.settings = BookstoreSettings(parent=self)
3233

3334
self.fs = s3fs.S3FileSystem(key=self.settings.s3_access_key_id,
@@ -41,7 +42,8 @@ def __init__(self, *args, **kwargs):
4142

4243
@property
4344
def delimiter(self):
44-
"""Normally this is overridable, for now just keeping this consistent"""
45+
"""It's a slash! Normally this could be configurable. This leaves room for that later,
46+
keeping it centralized for now"""
4547
return "/"
4648

4749
@property
@@ -50,6 +52,7 @@ def full_prefix(self):
5052
return self.delimiter.join([self.settings.s3_bucket, self.settings.workspace_prefix])
5153

5254
def s3_path(self, path):
55+
"""compute the s3 path based on the bucket, prefix, and the path to the notebook"""
5356
return self.delimiter.join([self.full_prefix, path])
5457

5558
def run_pre_save_hook(self, model, path, **kwargs):

bookstore/bookstore_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
from traitlets.config import LoggingConfigurable
1515

1616
class BookstoreSettings(LoggingConfigurable):
17+
"""The same settings to be shared across archival, publishing, and scheduling
18+
"""
19+
1720
workspace_prefix = Unicode("workspace", help="Prefix for the live workspace notebooks").tag(config=True)
1821
published_prefix = Unicode("published", help="Prefix for published notebooks").tag(config=True)
1922

@@ -33,5 +36,5 @@ class BookstoreSettings(LoggingConfigurable):
3336
"us-east-1", help="Region name").tag(
3437
config=True, env="JPYNB_S3_REGION_NAME")
3538
s3_bucket = Unicode(
36-
"notebooks", help="Bucket name to store notebooks").tag(
39+
"bookstore", help="Bucket name to store notebooks").tag(
3740
config=True, env="JPYNB_S3_BUCKET")

0 commit comments

Comments
 (0)