Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _load_outdated(self):
"""Get the latest compatible version"""
info = get_app_info(app_dir=self.app_dir, logger=self.log)
names = tuple(info['extensions'].keys())
data = yield self.executor.submit(
get_latest_compatible_package_versions,
names,
app_dir=self.app_dir,
logger=self.log,
)
raise gen.Return(data)
import sys
from jupyterlab.commands import get_app_info
from notebook.nbextensions import validate_nbextension
from notebook.serverextensions import validate_serverextension
if validate_nbextension('pywwt/extension') != []:
print("Issue detected with nbextension")
sys.exit(1)
print("nbextension OK")
info = get_app_info()
if 'pywwt' not in info['extensions'] or 'pywwt' in info['disabled']:
print("Issue detected with labextension")
sys.exit(1)
print("labextension OK")
if validate_serverextension('pywwt') != []:
print("Issue detected with serverextension")
sys.exit(1)
print("serverextension OK")
import logging
import sys
from jupyterlab.commands import get_app_info
from notebook.nbextensions import validate_nbextension
from notebook.serverextensions import validate_serverextension
# If there's a problem and we don't provide this, the validate function crashes :-(
logger = logging.getLogger('')
if validate_nbextension('pywwt/extension', logger=logger) != []:
print("Issue detected with nbextension")
sys.exit(1)
info = get_app_info()
if 'pywwt' not in info['extensions'] or 'pywwt' in info['disabled']:
print("Issue detected with labextension")
sys.exit(1)
if validate_serverextension('pywwt', logger=logger) != []:
print("Issue detected with serverextension")
sys.exit(1)
def list_extensions(self):
"""Handle a request for all installed extensions"""
info = get_app_info(app_dir=self.app_dir, logger=self.log)
build_check_info = _build_check_info(self.app_dir, self.log)
_ensure_compat_errors(info, self.app_dir, self.log)
extensions = []
# TODO: Ensure loops can run in parallel
for name, data in info['extensions'].items():
status = 'ok'
pkg_info = yield self._get_pkg_info(name, data)
if info['compat_errors'].get(name, None):
status = 'error'
else:
for packages in build_check_info.values():
if name in packages:
status = 'warning'
extensions.append(_make_extension_entry(
name=name,
description=pkg_info['description'],
if core_mode:
app_dir = HERE
logger.info(CORE_NOTE.strip())
ensure_core(logger)
elif dev_mode:
app_dir = DEV_DIR
ensure_dev(logger)
if not watch_mode:
logger.info(DEV_NOTE)
config.app_settings_dir = pjoin(app_dir, 'settings')
config.schemas_dir = pjoin(app_dir, 'schemas')
config.themes_dir = pjoin(app_dir, 'themes')
config.workspaces_dir = workspaces_dir
info = get_app_info(app_dir)
config.app_version = info['version']
public_url = info['publicUrl']
if public_url:
config.public_url = public_url
else:
config.static_dir = pjoin(app_dir, 'static')
config.user_settings_dir = user_settings_dir
# The templates end up in the built static directory.
config.templates_dir = pjoin(app_dir, 'static')
if watch_mode:
logger.info('Starting JupyterLab watch mode...')
# Set the ioloop in case the watch fails.