From 3381140ec08a1ca550749897013403e0a0917f1e Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Thu, 26 Sep 2013 21:53:03 +0000 Subject: [PATCH] 7088: provide a config option to suppress the warning about missing "sdn" svn: r23207 --- gramps/gen/config.py | 1 + gramps/gen/lib/calendar.py | 10 ++++++---- gramps/gui/configure.py | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gramps/gen/config.py b/gramps/gen/config.py index 5bf0fd468..af3c73789 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -143,6 +143,7 @@ register('behavior.generation-depth', 15) register('behavior.ignore-gexiv2', False) register('behavior.ignore-osmgpsmap', False) register('behavior.ignore-spellcheck', False) +register('behavior.ignore-sdn', False) register('behavior.max-age-prob-alive', 110) register('behavior.max-sib-age-diff', 20) register('behavior.min-generation-years', 13) diff --git a/gramps/gen/lib/calendar.py b/gramps/gen/lib/calendar.py index acdcf8b84..f8bd9376d 100644 --- a/gramps/gen/lib/calendar.py +++ b/gramps/gen/lib/calendar.py @@ -580,7 +580,9 @@ try: #TODO maybe alias the other local invented wheels to Calendar convertors except ImportError: - import logging - LOG = logging.getLogger(".calendar") - LOG.warn("sdn not available. " - "Install Calendar with pypi for native Hebrew calendar calculations.") + from gramps.gen.config import config + if not config.get('behavior.ignore-sdn'): + import logging + LOG = logging.getLogger(".calendar") + LOG.warn("sdn not available. " + "Install Calendar with pypi for native Hebrew calendar calculations.") diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 5b1fe09a5..30d708968 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -621,6 +621,10 @@ class GrampsPreferences(ConfigureDialog): table, _('Suppress warning when spell checking not installed.'), 6, 'behavior.ignore-spellcheck') + self.add_checkbox( + table, _("Suppress warning when 'sdn' not installed."), + 7, 'behavior.ignore-sdn') + return _('Warnings'), table def _build_name_format_model(self, active):