Template option differentiates core/plugins
@@ -9,6 +9,11 @@ class TemplateForm(npyscreen.ActionForm):
""" Template form for the Vent CLI """
def __init__(self, *args, **kargs):
""" Initialize template form objects """
+ if kargs['action_dict']:
+ if kargs['action_dict']['cores']:
+ self.core = True
+ else:
+ self.core = False
self.logger = Logger(__name__)
self.api_action = Action()
self.manifest = os.path.join(self.api_action.plugin.path_dirs.meta_dir,
@@ -24,7 +29,14 @@ class TemplateForm(npyscreen.ActionForm):
self.add_handlers({"^T": self.quit, "^Q": self.quit})
self.add(npyscreen.TitleText, name="Select which tools' template(s) to update",
editable=False)
+ if self.core:
status, inventory = self.api_action.inventory(choices=['core'])
if status:
for tool in inventory['core']:
self.tools[tool[0]] = self.add(npyscreen.CheckBox, name=tool[1], value=True)
+ else:
+ self.add(npyscreen.TitleFixedText, name='a', value='a')
+
+ def on_cancel(self):
+ """ When user clicks cancel, will return to MAIN """
+ self.quit()
