From be850a40c6f7baf0ce30ce8beff1456a8b8f4889 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 16 Jan 2005 19:14:14 +0000 Subject: [PATCH] * src/ReportOptions.py (OptionHandler.set_options): svn: r3918 --- gramps2/ChangeLog | 2 ++ gramps2/src/ReportOptions.py | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1c9dd5b1b..c26be09a5 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -2,6 +2,8 @@ * src/Plugins.py (reload_plugins): Check for status. * src/Report.py: pychecker fixes * src/plugins/FamilyGroup.py (dump_parent): Typo. + * src/ReportOptions.py (OptionHandler.set_options): + Ignore unknown options. 2005-01-15 Don Allingham * src/EditPerson.py: don't use quote date diff --git a/gramps2/src/ReportOptions.py b/gramps2/src/ReportOptions.py index 0a9b6c778..84e7abc1d 100644 --- a/gramps2/src/ReportOptions.py +++ b/gramps2/src/ReportOptions.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2004 Donald N. Allingham +# Copyright (C) 2004-2005 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 @@ -488,12 +488,20 @@ class OptionHandler: """ # First we set options_dict values based on the saved options options = self.saved_option_list.get_options() + bad_opts = [] for option_name in options.keys(): + if not self.options_dict.has_key(option_name): + print "Option %s is present in the ~/.gramps/report_options.xml but is not known to the report." % option_name + print "Ignoring..." + bad_opts.append(option_name) + continue try: converter = Utils.get_type_converter(self.options_dict[option_name]) self.options_dict[option_name] = converter(options[option_name]) except ValueError: pass + for option_name in bad_opts: + options.pop(option_name) # Then we set common options from whatever was found if self.saved_option_list.get_style_name():