Permalink
Browse files

Fixed ERROR message formatting.

  • Loading branch information...
1 parent bff0e88 commit cede443e93fd5030f32c08f2268505b6bfaf1398 @dagoodma dagoodma committed with Sep 22, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 generate.py
View
@@ -167,11 +167,19 @@ def generateHeaders(self):
tkinter.messagebox.showinfo('Successfully Generated Headers', 'Headers generated succesfully.')
except Exception as ex:
+ exStr = formatErrorMessage(str(ex));
if DEBUG:
print('An occurred while generating headers:\n\t{0!s}'.format(ex))
- tkinter.messagebox.showerror('Error Generating Headers','An error occurred in mavgen: {0!s}'.format(ex))
+ tkinter.messagebox.showerror('Error Generating Headers','An error occurred in mavgen:\n{0!s}'.format(exStr))
return
+"""\
+Format the mavgen exceptions by removing "ERROR: ".
+"""
+def formatErrorMessage(message):
+ reObj = re.compile(r'^ERROR:\s+',re.M);
+ return re.sub(reObj, '', message)
+
# End of Application class
# ---------------------------------

0 comments on commit cede443

Please sign in to comment.