From 8cc3dab32e545a4a3014e2ae0864ee67972058c3 Mon Sep 17 00:00:00 2001 From: telamonian Date: Thu, 5 Dec 2019 10:22:11 -0600 Subject: [PATCH] added warning about reinstalling extensions to help and `lab clean` output --- jupyterlab/commands.py | 2 ++ jupyterlab/labapp.py | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/jupyterlab/commands.py b/jupyterlab/commands.py index 662cf809f04a..0de688edaac8 100644 --- a/jupyterlab/commands.py +++ b/jupyterlab/commands.py @@ -459,6 +459,8 @@ def clean(app_dir=None, logger=None, app_options=None): logger.info('%s not present, skipping...', name) logger.info('Success!') + if app_options.all or app_options.extensions: + logger.info('All of your extensions have been removed, and will need to be reinstalled') def build(app_dir=None, name=None, version=None, static_url=None, diff --git a/jupyterlab/labapp.py b/jupyterlab/labapp.py index d3050214d638..9dd57d2e7052 100644 --- a/jupyterlab/labapp.py +++ b/jupyterlab/labapp.py @@ -101,11 +101,15 @@ def start(self): clean_aliases = dict(base_aliases) clean_aliases['app-dir'] = 'LabCleanApp.app_dir' +ext_warn_msg = "WARNING: this will delete all of your extensions, which will need to be reinstalled" + clean_flags = dict(base_flags) -clean_flags['extensions'] = ({'LabCleanApp': {'extensions': True}}, 'Also delete /extensions') +clean_flags['extensions'] = ({'LabCleanApp': {'extensions': True}}, + 'Also delete /extensions.\n%s' % ext_warn_msg) clean_flags['settings'] = ({'LabCleanApp': {'settings': True}}, 'Also delete /settings') clean_flags['static'] = ({'LabCleanApp': {'static': True}}, 'Also delete /static') -clean_flags['all'] = ({'LabCleanApp': {'all': True}}, 'Delete the entire contents of the app directory') +clean_flags['all'] = ({'LabCleanApp': {'all': True}}, + 'Delete the entire contents of the app directory.\n%s' % ext_warn_msg) class LabCleanAppOptions(AppOptions): @@ -133,13 +137,15 @@ class LabCleanApp(JupyterApp): app_dir = Unicode('', config=True, help='The app directory to clean') - extensions = Bool(False, config=True, help="Also delete /extensions") + extensions = Bool(False, config=True, + help="Also delete /extensions.\n%s" % ext_warn_msg) settings = Bool(False, config=True, help="Also delete /settings") static = Bool(False, config=True, help="Also delete /static") - all = Bool(False, config=True, help="Delete the entire contents of the app directory") + all = Bool(False, config=True, + help="Delete the entire contents of the app directory.\n%s" % ext_warn_msg) def start(self): app_options = LabCleanAppOptions(