mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-18 11:55:46 +08:00
Merge pull request #3541 from ivanov/extension-version
basic __version__ reporting for extensions
This commit is contained in:
commit
8034d71429
@ -103,6 +103,7 @@ def validate_serverextension(import_name, logger=None):
|
|||||||
try:
|
try:
|
||||||
mod = importlib.import_module(import_name)
|
mod = importlib.import_module(import_name)
|
||||||
func = getattr(mod, 'load_jupyter_server_extension', None)
|
func = getattr(mod, 'load_jupyter_server_extension', None)
|
||||||
|
version = getattr(mod, '__version__', '')
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warning("Error loading server extension %s", import_name)
|
logger.warning("Error loading server extension %s", import_name)
|
||||||
|
|
||||||
@ -118,7 +119,7 @@ def validate_serverextension(import_name, logger=None):
|
|||||||
[logger.info(info) for info in infos]
|
[logger.info(info) for info in infos]
|
||||||
[logger.warn(warning) for warning in warnings]
|
[logger.warn(warning) for warning in warnings]
|
||||||
else:
|
else:
|
||||||
logger.info(post_mortem.format(import_name, "", GREEN_OK))
|
logger.info(post_mortem.format(import_name, version, GREEN_OK))
|
||||||
|
|
||||||
return warnings
|
return warnings
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user