diff --git a/gramps/gen/lib/calendar.py b/gramps/gen/lib/calendar.py index 7d963fa2d..bb0fd8ff1 100644 --- a/gramps/gen/lib/calendar.py +++ b/gramps/gen/lib/calendar.py @@ -23,7 +23,7 @@ """ Provide calendar to sdn (serial date number) conversion. """ -from __future__ import division +from __future__ import division, print_function #------------------------------------------------------------------------- # # Python modules @@ -261,7 +261,7 @@ def hebrew_sdn(year, month, day): return sdn + _HBR_SDN_OFFSET def hebrew_ymd(sdn): - """Convert an SDN number to a Julian calendar date.""" + """Convert an SDN number to a Hebrew calendar date.""" input_day = sdn - _HBR_SDN_OFFSET @@ -573,3 +573,14 @@ def swedish_ymd(sdn): return gregorian_ymd(sdn) else: return julian_ymd(sdn) + +try: + import sdn + + hebrew_ymd = sdn.SdnToJewish # Fix bug# 7066 + hebrew_sdn = sdn.JewishToSdn + #TODO maybe alias the other local invented wheels to Calendar convertors +except ImportError: + import sys + print("No sdn module. Install Calendar with pypi." + "hebrew_sdn has a known bug# 7066!!!", file=sys.stderr) diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py index 34f72ab40..1255962bb 100644 --- a/gramps/grampsapp.py +++ b/gramps/grampsapp.py @@ -320,6 +320,12 @@ def show_settings(): except: gsversion_str = 'Ghostscript not in system PATH' + try: + import sdn + sdn_str = sdn.__version__ + except ImportError: + sdn_str = 'not found' + os_path = os.environ.get('PATH','not set') os_path = os_path.split(os.pathsep) @@ -342,6 +348,7 @@ def show_settings(): print (' GExiv2 : %s' % gexiv2_str) print (' ICU : %s' % icu_str) print (' PyICU : %s' % pyicu_str) + print (' sdn : %s' % sdn_str) print (' o.s. : %s' % sys.platform) if kernel: print (' kernel : %s' % kernel)