8971: the easter method in libholiday.py isn't Python3-friendly

This commit is contained in:
=Vlada Perić 2015-10-04 16:24:32 -07:00 committed by Paul Franklin
parent 1b09074fc4
commit 05a53a40c9

View File

@ -1,8 +1,11 @@
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008-2009 Brian G. Matherly # Copyright (C) 2008-2009 Brian G. Matherly
# Copyright (C) 2009 Rob G. Healey <robhealey1@gmail.com> # Copyright (C) 2009 Rob G. Healey <robhealey1@gmail.com>
# Copyright (C) 2014 Vlada Perić <vlada.peric@gmail.com>
# #
# 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
@ -56,18 +59,17 @@ def easter(year):
to the Astronomical Almanac", ed. P. K. Seidelmann (1992). Note: to the Astronomical Almanac", ed. P. K. Seidelmann (1992). Note:
Ash Wednesday is 46 days before Easter Sunday. Ash Wednesday is 46 days before Easter Sunday.
""" """
c = year / 100 c = year // 100
n = year - 19 * (year / 19) n = year - 19 * (year // 19)
k = (c - 17) / 25 k = (c - 17) // 25
i = c - c / 4 - (c - k) / 3 + 19 * n + 15 i = c - c // 4 - (c - k) // 3 + 19 * n + 15
i = i - 30 * (i / 30) i = i - 30 * (i // 30)
i = i - (i / 28) * (1 - (i / 28) * (29 / (i + 1)) i = i - (i // 28) * (1 - (i // 28) * (29 // (i + 1)) * ((21 - n) // 11) )
* ((21 - n) / 11)) j = year + year // 4 + i + 2 - c + c // 4
j = year + year / 4 + i + 2 - c + c / 4 j = j - 7 * (j // 7)
j = j - 7 * (j / 7)
l = i - j l = i - j
month = 3 + (l + 40) / 44 month = 3 + (l + 40) // 44
day = l + 28 - 31 * (month / 4) day = l + 28 - 31 * (month // 4)
return "%d/%d/%d" % (year, month, day) return "%d/%d/%d" % (year, month, day)
def julian_easter(year): def julian_easter(year):