Skip to content

Commit e909776

Browse files
committed
make static_url_prefix configurable
1 parent 56b06d2 commit e909776

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

jupyter_server/extension/application.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,11 @@ def _default_log_format(self):
188188
"""override default log format to include date & time"""
189189
return u"%(color)s[%(levelname)1.1s %(asctime)s.%(msecs).03d %(name)s]%(end_color)s %(message)s"
190190

191-
@property
192-
def static_url_prefix(self):
193-
static_url = "static/{name}".format(
191+
static_url_prefix = Unicode().tag(config=True)
192+
193+
@default('static_url_prefix')
194+
def _default_static_url_prefix(self):
195+
static_url = "static/{name}/".format(
194196
name=self.name
195197
)
196198
return urljoin(self.serverapp.base_url, static_url)
@@ -429,7 +431,7 @@ def launch_instance(cls, argv=None, **kwargs):
429431
if argv is None:
430432
args = sys.argv[1:] # slice out extension config.
431433
else:
432-
args = []
434+
args = argv
433435
# Check for subcommands
434436
subapp = _preparse_for_subcommand(cls, args)
435437
if subapp:

jupyter_server/extension/handler.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ def base_url(self):
5656

5757
@property
5858
def static_url_prefix(self):
59-
static_url = "static/{name}".format(
60-
name=self.name
61-
)
62-
return urljoin(self.serverapp.base_url, static_url)
59+
return self.extensionapp.static_url_prefix
6360

6461
@property
6562
def static_path(self):

0 commit comments

Comments
 (0)