def render(self): if len(self.step_metas) == 0: self.finish(None, None, done=True) return step_widgets = deque() for step_meta_path in self.step_metas: step_ex_path, ext = path.splitext(step_meta_path) if not path.isfile(step_ex_path) or \ not os.access(step_ex_path, os.X_OK): app.log.error( 'Unable to process step, missing {}'.format(step_ex_path)) continue step_metadata = {} with open(step_meta_path) as fp: step_metadata = yaml.load(fp.read()) try: # Store step model and its widget model = StepModel(step_metadata, step_meta_path) step_widget = StepWidget( app, model, self.finish) if not step_widget.model.viewable: app.log.debug("Skipping step: {}".format(step_widget)) continue model.path = step_ex_path step_widgets.append(step_widget) app.log.debug("Queueing step: {}".format(step_widget)) except Exception as e: self.__handle_exception('E002', e) return try: self.all_step_widgets = list(step_widgets) self.view = StepsView(app, step_widgets, self.finish) # Set initial step as active and viewable step_widgets[0].description.set_text(( 'body', step_widgets[0].model.description)) step_widgets[0].icon.set_text(( 'pending_icon', step_widgets[0].icon.get_text()[0] )) step_widgets[0].generate_additional_input() self.view.step_pile.focus_position = 2 except Exception as e: self.__handle_exception('E002', e) return app.ui.set_header( title="Additional Application Configuration", excerpt="Please finish the installation by configuring your " "application with these steps.") app.ui.set_body(self.view) app.ui.set_footer('') self.update()
def render(self): if len(self.step_metas) == 0: self.finish(None, None, done=True) return step_widgets = deque() for step_meta_path in self.step_metas: step_ex_path, ext = path.splitext(step_meta_path) if not path.isfile(step_ex_path) or \ not os.access(step_ex_path, os.X_OK): app.log.error( 'Unable to process step, missing {}'.format(step_ex_path)) continue step_metadata = {} with open(step_meta_path) as fp: step_metadata = yaml.load(fp.read()) try: # Store step model and its widget model = StepModel(step_metadata, step_meta_path) step_widget = StepWidget(app, model, self.finish) if not step_widget.model.viewable: app.log.debug("Skipping step: {}".format(step_widget)) continue model.path = step_ex_path step_widgets.append(step_widget) app.log.debug("Queueing step: {}".format(step_widget)) except Exception as e: self.__handle_exception('E002', e) return try: self.all_step_widgets = list(step_widgets) self.view = StepsView(app, step_widgets, self.finish) # Set initial step as active and viewable step_widgets[0].description.set_text( ('body', step_widgets[0].model.description)) step_widgets[0].icon.set_text( ('pending_icon', step_widgets[0].icon.get_text()[0])) step_widgets[0].generate_additional_input() self.view.step_pile.focus_position = 2 except Exception as e: self.__handle_exception('E002', e) return app.ui.set_header( title="Additional Application Configuration", excerpt="Please finish the installation by configuring your " "application with these steps.") app.ui.set_body(self.view) app.ui.set_footer('') self.update()
def render(self): for step_meta_path in self.step_metas: step_ex_path, ext = path.splitext(step_meta_path) if not path.isfile(step_ex_path) or \ not os.access(step_ex_path, os.X_OK): app.log.error( 'Unable to process step, missing {}'.format(step_ex_path)) continue step_metadata = {} with open(step_meta_path) as fp: step_metadata = yaml.load(fp.read()) model = StepModel(step_metadata, step_meta_path) model.path = step_ex_path app.log.debug("Running step: {}".format(model)) try: step_model, _ = common.do_step(model, None, utils.info) self.results[step_model.title] = step_model.result except Exception as e: utils.error("Failed to run {}: {}".format(model.path, e)) sys.exit(1) self.finish()