* src/ReportOptions.py (OptionHandler.set_options):

svn: r3918
This commit is contained in:
Alex Roitman 2005-01-16 19:14:14 +00:00
parent 5c08a9cb9a
commit be850a40c6
2 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,8 @@
* src/Plugins.py (reload_plugins): Check for status. * src/Plugins.py (reload_plugins): Check for status.
* src/Report.py: pychecker fixes * src/Report.py: pychecker fixes
* src/plugins/FamilyGroup.py (dump_parent): Typo. * src/plugins/FamilyGroup.py (dump_parent): Typo.
* src/ReportOptions.py (OptionHandler.set_options):
Ignore unknown options.
2005-01-15 Don Allingham <dallingham@users.sourceforge.net> 2005-01-15 Don Allingham <dallingham@users.sourceforge.net>
* src/EditPerson.py: don't use quote date * src/EditPerson.py: don't use quote date

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # 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 # First we set options_dict values based on the saved options
options = self.saved_option_list.get_options() options = self.saved_option_list.get_options()
bad_opts = []
for option_name in options.keys(): 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: try:
converter = Utils.get_type_converter(self.options_dict[option_name]) converter = Utils.get_type_converter(self.options_dict[option_name])
self.options_dict[option_name] = converter(options[option_name]) self.options_dict[option_name] = converter(options[option_name])
except ValueError: except ValueError:
pass pass
for option_name in bad_opts:
options.pop(option_name)
# Then we set common options from whatever was found # Then we set common options from whatever was found
if self.saved_option_list.get_style_name(): if self.saved_option_list.get_style_name():