mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 17:30:59 +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'
|
||||
# ' 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,
|
||||
then __xonsh_ctx__ is updated.
|
||||
"""
|
||||
|
@ -72,8 +72,9 @@ def update_context(name, ctx=None, missing_specs=[]):
|
|||
ctx = builtins.__xonsh_ctx__
|
||||
modctx = xontrib_context(name)
|
||||
if modctx == {}:
|
||||
missing_specs.append(name)
|
||||
return ctx.update(modctx)
|
||||
return False
|
||||
ctx.update(modctx)
|
||||
return True
|
||||
|
||||
|
||||
@functools.lru_cache()
|
||||
|
@ -91,7 +92,9 @@ def _load(ns):
|
|||
for name in ns.names:
|
||||
if ns.verbose:
|
||||
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)
|
||||
if missing_specs:
|
||||
prompt_xontrib_install(missing_specs)
|
||||
|
|
Loading…
Add table
Reference in a new issue