CLI: fix up the previous broken commit

This commit is contained in:
Mike Auty
2020-08-22 11:55:23 +01:00
parent fc5b051692
commit 288a017178
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -272,7 +272,7 @@ class CommandLine(interfaces.plugins.FileConsumerInterface):
# It should be up to the UI to determine which automagics to run, so this is before BACK TO THE FRAMEWORK
automagics = automagic.choose_automagic(automagics, plugin)
for amagic in automagics:
chosen_configurables_list[plugin] = plugin
chosen_configurables_list[amagic.__class__.__name__] = amagic
if ctx.config.get('automagic.LayerStacker.stackers', None) is None:
ctx.config['automagic.LayerStacker.stackers'] = stacker.choose_os_stackers(plugin)
+4 -3
View File
@@ -44,11 +44,12 @@ def available(context: interfaces.context.ContextInterface) -> List[interfaces.a
clazz(context, interfaces.configuration.path_join(config_path, clazz.__name__))
for clazz in class_subclasses(interfaces.automagic.AutomagicInterface)
],
key = lambda x: x.priority)
key = lambda x: x.priority)
def choose_automagic(automagics: List[interfaces.automagic.AutomagicInterface],
plugin: Type[interfaces.plugins.PluginInterface]):
def choose_automagic(
automagics: List[interfaces.automagic.AutomagicInterface],
plugin: Type[interfaces.plugins.PluginInterface]) -> List[Type[interfaces.automagic.AutomagicInterface]]:
"""Chooses which automagics to run, maintaining the order they were handed
in."""