Skip to content

Commit

Permalink
remove isModelCorrect method whose functionality was incorporated int…
Browse files Browse the repository at this point in the history
…o checkModel in previous commit
  • Loading branch information
tsole0 committed Jun 24, 2024
1 parent 558c7a1 commit 54a8aaf
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/sas/qtgui/Utilities/TabbedModelEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,41 +420,6 @@ def checkModel(self, full_path, run_unit_test=True):

return error_line

def isModelCorrect(self, full_path):
"""
Run the sasmodels method for model check
and return True if the model is good.
False otherwise.
"""
successfulCheck = True
try:
model_results = GuiUtils.checkModel(full_path)
logging.info(model_results)
# We can't guarantee the type of the exception coming from
# Sasmodels, so need the overreaching general Exception
except Exception as ex:
msg = "Error building model: "+ str(ex)
logging.error(msg)
#print three last lines of the stack trace
# this will point out the exact line failing
last_lines = traceback.format_exc().split('\n')[-4:]
traceback_to_show = '\n'.join(last_lines)
logging.error(traceback_to_show)

# Set the status bar message
self.parent.communicate.statusBarUpdateSignal.emit("Model check failed")

# Remove the file so it is not being loaded on refresh
os.remove(full_path)
# Put a thick, red border around the mini-editor
self.plugin_widget.txtFunction.setStyleSheet("border: 5px solid red")
# Use the last line of the traceback for the tooltip
last_lines = traceback.format_exc().split('\n')[-2:]
traceback_to_show = '\n'.join(last_lines)
self.plugin_widget.txtFunction.setToolTip(traceback_to_show)
successfulCheck = False
return successfulCheck

def updateFromEditor(self):
"""
Save the current state of the Model Editor
Expand Down

0 comments on commit 54a8aaf

Please sign in to comment.