From 4412b4bd6cf0d6ba42202ee4b3dffef20e02fb68 Mon Sep 17 00:00:00 2001 From: Peter Parente Date: Mon, 4 Jul 2016 17:34:10 -0400 Subject: [PATCH] Improve bundler list output Include label and module name (if available) to help a user remember which Python module provides which bundler(s) (c) Copyright IBM Corp. 2016 --- notebook/bundler/bundlerextensions.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/notebook/bundler/bundlerextensions.py b/notebook/bundler/bundlerextensions.py index e9ff3a825..b77172afb 100644 --- a/notebook/bundler/bundlerextensions.py +++ b/notebook/bundler/bundlerextensions.py @@ -246,7 +246,7 @@ class ListBundlerExtensionApp(BaseNBExtensionApp): """List all the nbextensions""" config_dirs = [os.path.join(p, 'nbconfig') for p in jupyter_config_path()] - print("Known nbextensions:") + print("Known bundlerextensions:") for config_dir in config_dirs: head = u' config dir: {}'.format(config_dir) @@ -262,9 +262,14 @@ class ListBundlerExtensionApp(BaseNBExtensionApp): for bundler_id, info in data['bundlerextensions'].items(): label = info.get('label') - print(u' {} {}'.format( - label if label is not None else bundler_id, - GREEN_ENABLED if label else RED_DISABLED)) + module = info.get('module_name') + if label is None or module is None: + msg = u' {} {}'.format(bundler_id, RED_DISABLED) + else: + msg = u' "{}" from {} {}'.format( + label, module, GREEN_ENABLED + ) + print(msg) def start(self): """Perform the App's functions as configured"""