mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-09 02:41:00 +01:00
fix list of bad xontribs
This commit is contained in:
parent
e59ad33295
commit
e4eeb30782
1 changed files with 7 additions and 4 deletions
|
@ -64,7 +64,7 @@ def prompt_xontrib_install(names):
|
||||||
# 'To install it run \n'
|
# 'To install it run \n'
|
||||||
# ' pip install {package}')
|
# ' pip install {package}')
|
||||||
|
|
||||||
def update_context(name, ctx=None, missing_specs=[]):
|
def update_context(name, ctx=None):
|
||||||
"""Updates a context in place from a xontrib. If ctx is not provided,
|
"""Updates a context in place from a xontrib. If ctx is not provided,
|
||||||
then __xonsh_ctx__ is updated.
|
then __xonsh_ctx__ is updated.
|
||||||
"""
|
"""
|
||||||
|
@ -72,8 +72,9 @@ def update_context(name, ctx=None, missing_specs=[]):
|
||||||
ctx = builtins.__xonsh_ctx__
|
ctx = builtins.__xonsh_ctx__
|
||||||
modctx = xontrib_context(name)
|
modctx = xontrib_context(name)
|
||||||
if modctx == {}:
|
if modctx == {}:
|
||||||
missing_specs.append(name)
|
return False
|
||||||
return ctx.update(modctx)
|
ctx.update(modctx)
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
@functools.lru_cache()
|
@functools.lru_cache()
|
||||||
|
@ -91,7 +92,9 @@ def _load(ns):
|
||||||
for name in ns.names:
|
for name in ns.names:
|
||||||
if ns.verbose:
|
if ns.verbose:
|
||||||
print('loading xontrib {0!r}'.format(name))
|
print('loading xontrib {0!r}'.format(name))
|
||||||
update_context(name, ctx=ctx, missing_specs=missing_specs)
|
res = update_context(name, ctx=ctx)
|
||||||
|
if not res:
|
||||||
|
missing_specs.append(name)
|
||||||
print(missing_specs)
|
print(missing_specs)
|
||||||
if missing_specs:
|
if missing_specs:
|
||||||
prompt_xontrib_install(missing_specs)
|
prompt_xontrib_install(missing_specs)
|
||||||
|
|
Loading…
Add table
Reference in a new issue