mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-17 12:39:54 +08:00
Fix horrible horrible widget with a more horrible hack 💩
This commit is contained in:
parent
255e5888fc
commit
7695311668
@ -271,17 +271,21 @@ class NotebookWebApplication(web.Application):
|
||||
handlers.extend(load_handlers('lab.handlers'))
|
||||
|
||||
# BEGIN HARDCODED WIDGETS HACK
|
||||
# TODO: Remove on notebook 5.0
|
||||
widgets = None
|
||||
try:
|
||||
import ipywidgets as widgets
|
||||
handlers.append(
|
||||
(r"/nbextensions/widgets/(.*)", FileFindHandler, {
|
||||
'path': widgets.find_static_assets(),
|
||||
'no_cache_paths': ['/'], # don't cache anything in nbextensions
|
||||
}),
|
||||
)
|
||||
import widgetsnbextension
|
||||
except:
|
||||
app_log.warning('Widgets are unavailable. Please install widgetsnbextension or ipywidgets 4.0')
|
||||
try:
|
||||
import ipywidgets as widgets
|
||||
handlers.append(
|
||||
(r"/nbextensions/widgets/(.*)", FileFindHandler, {
|
||||
'path': widgets.find_static_assets(),
|
||||
'no_cache_paths': ['/'], # don't cache anything in nbextensions
|
||||
}),
|
||||
)
|
||||
except:
|
||||
app_log.warning('Widgets are unavailable. Please install widgetsnbextension or ipywidgets 4.0')
|
||||
# END HARDCODED WIDGETS HACK
|
||||
|
||||
handlers.append(
|
||||
|
Loading…
Reference in New Issue
Block a user