Show errors in data in Load Events Dialog

This commit is contained in:
Xevion
2021-08-25 18:29:05 -05:00
parent dd17b1ebc9
commit 445bec8f53

View File

@@ -42,8 +42,12 @@ class LoadDialog(QDialog, Ui_Dialog):
"""Parse the events entered into the dialog"""
self.spinner.hide()
results = [result.groups() for result in re.finditer(REGEX, self.plainTextEdit.toPlainText())]
self.eventCountLabel.setText(f'{len(results)} group{"s" if len(results) != 1 else ""} found.')
self.parsed = list(map(Event.parse_raw, results))
resultsText = f'{len(results)} group{"s" if len(results) != 1 else ""} found.'
try:
self.parsed = list(map(Event.parse_raw, results))
except ValueError:
resultsText += ' Data error.'
self.eventCountLabel.setText(resultsText)
def edited(self) -> None:
"""Prepare a timer to be fired to parse the edited text"""