def read(self, file_path, keyword_list): try: property_data, model_name = self.createProperties(file_path) model = DataGuru.createModel(property_data, model_name) except: Printer.Print("File not found") return ResultObject(None, None, None, CommandStatus.Error) command_status = CommandStatus.Success result_data = [model, property_data, model_name, self.updateModel] result_object = ResultObject(result_data, keyword_list, DataType.algorithm_arg, command_status, add_to_cache=True) result_object.createName(keyword_list) if (PropertyEditor.parent_widget is None or PropertyEditor.property_editor_class is None): Printer.Print("Cannot modify algorithm properties in non-GUI mode") else: property_editor = PropertyEditor.property_editor_class( result_object) PropertyEditor.addPropertyEditor(property_editor) return result_object
def updateModel(self, result_data): properties = result_data[1] model_name = result_data[2] print("Properties: ", properties) result_data[0] = DataGuru.createModel(properties, model_name)