mirror of
https://github.com/Xevion/bulk-reminders.git
synced 2025-12-07 16:06:37 -06:00
Show errors in data in Load Events Dialog
This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user