Skip to content

Commit e70e7be

Browse files
committed
remove unused code in nbextensions
- unused imports - call jupyter_path instead of reimplementing it
1 parent 1797f34 commit e70e7be

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

notebook/nbextensions.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from urllib import urlretrieve
2222

2323
from jupyter_core.paths import (
24-
jupyter_data_dir, jupyter_config_dir, jupyter_config_path,
25-
SYSTEM_JUPYTER_PATH, ENV_JUPYTER_PATH, ENV_CONFIG_PATH, SYSTEM_CONFIG_PATH
24+
jupyter_data_dir, jupyter_config_path, jupyter_path,
25+
SYSTEM_JUPYTER_PATH, ENV_JUPYTER_PATH,
2626
)
2727
from ipython_genutils.path import ensure_dir_exists
2828
from ipython_genutils.py3compat import string_types, cast_unicode_py2
@@ -484,7 +484,7 @@ def validate_nbextension(require, logger=None):
484484
infos = []
485485

486486
js_exists = False
487-
for exts in _nbextension_dirs():
487+
for exts in jupyter_path('nbextensions'):
488488
# Does the Javascript entrypoint actually exist on disk?
489489
js = u"{}.js".format(os.path.join(exts, *require.split("/")))
490490
js_exists = os.path.exists(js)
@@ -1014,18 +1014,6 @@ def _get_nbextension_dir(user=False, sys_prefix=False, prefix=None, nbextensions
10141014
return nbext
10151015

10161016

1017-
def _nbextension_dirs():
1018-
"""The possible locations of nbextensions.
1019-
1020-
Returns a list of known base extension locations
1021-
"""
1022-
return [
1023-
pjoin(jupyter_data_dir(), u'nbextensions'),
1024-
pjoin(ENV_JUPYTER_PATH[0], u'nbextensions'),
1025-
pjoin(SYSTEM_JUPYTER_PATH[0], 'nbextensions')
1026-
]
1027-
1028-
10291017
def _get_nbextension_metadata(module):
10301018
"""Get the list of nbextension paths associated with a Python module.
10311019

0 commit comments

Comments
 (0)