diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 7bf8b9b0b..a752296d6 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2007-06-17 Alex Roitman + * src/GrampsCfg.py (NameFormatEditDlg.cb_format_changed): Catch + exception when format string is invalid. + 2007-06-16 Alex Roitman * src/gramps.py (run): Catch SystemExit exception. * src/ArgHandler.py: Use sys.exit() for bailing out. diff --git a/gramps2/src/GrampsCfg.py b/gramps2/src/GrampsCfg.py index 885c0e60c..81f430d6a 100644 --- a/gramps2/src/GrampsCfg.py +++ b/gramps2/src/GrampsCfg.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -610,8 +610,12 @@ class NameFormatEditDlg: return (self.response, self.fmt_name, self.fmt_str) def cb_format_changed(self,obj): - t = (_nd.format_str(self.name,obj.get_text())) - self.examplelabel.set_text('%s' % t) + try: + t = (_nd.format_str(self.name,obj.get_text())) + except ValueError, msg: + t = _("Invalid format string: %s") % msg + self.examplelabel.set_text( + '%s' % t) self.examplelabel.set_use_markup(True)