/usr/lib64/python2.6/site-packages/mx/DateTime
NameSizeModeActions
mxDateTime/-0755rm
ARPA.py76160644editdlrm
ARPA.pyc74800644editdlrm
ARPA.pyo74800644editdlrm
COPYRIGHT10300644editdlrm
DateTime.py321190644editdlrm
DateTime.pyc273180644editdlrm
DateTime.pyo272170644editdlrm
Feasts.py28560644editdlrm
Feasts.pyc46590644editdlrm
Feasts.pyo46590644editdlrm
ISO.py104410644editdlrm
ISO.pyc103810644editdlrm
ISO.pyo103810644editdlrm
LazyModule.py44000644editdlrm
LazyModule.pyc42720644editdlrm
LazyModule.pyo42720644editdlrm
LICENSE45870644editdlrm
Locale.py45840644editdlrm
Locale.pyc58500644editdlrm
Locale.pyo58500644editdlrm
NIST.py145840644editdlrm
NIST.pyc135790644editdlrm
NIST.pyo135790644editdlrm
ODMG.py52620644editdlrm
ODMG.pyc76600644editdlrm
ODMG.pyo76600644editdlrm
Parser.py425430644editdlrm
Parser.pyc364050644editdlrm
Parser.pyo364050644editdlrm
README1420644editdlrm
timegm.py28330644editdlrm
timegm.pyc30950644editdlrm
timegm.pyo30950644editdlrm
Timezone.py50960644editdlrm
Timezone.pyc36520644editdlrm
Timezone.pyo36520644editdlrm
__init__.py17080644editdlrm
__init__.pyc21800644editdlrm
__init__.pyo21800644editdlrm
Edit: /usr/lib64/python2.6/site-packages/mx/DateTime/Feasts.py (2856B)
""" Calculate moveable feasts that depend on the date of Easter Sunday. Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2008, eGenix.com Software GmbH; mailto:info@egenix.com See the documentation for further information on copyrights, or contact the author. All Rights Reserved. """ import DateTime _eastereggs = {} def EasterSunday(year): """EasterSunday(year) Return a DateTime instance pointing to Easter Sunday of the given year. Note: it must be given *with* century. Based on the algorithm presented in the Calendar FAQ by Claus Tondering (http://www.pip.dknet.dk/~pip10160/calendar.html), which in return is based on the algorithm of Oudin (1940) as quoted in "Explanatory Supplement to the Astronomical Almanac", P. Kenneth Seidelmann, editor.""" if _eastereggs.has_key(year): return _eastereggs[year] G = year % 19 C = year/100 H = (C - C/4 - (8*C+13)/25 + 19*G + 15) % 30 I = H - (H/28)*(1 - (H/28)*(29/(H + 1))*((21 - G)/11)) J = (year + year/4 + I + 2 - C + C/4) % 7 L = I - J month = 3 + (L + 40)/44 day = L + 28 - 31*(month/4) _eastereggs[year] = d = DateTime.DateTime(year,month,day) return d Ostersonntag = EasterSunday DimanchePaques = EasterSunday # Some common feasts derived from Easter Sunday def CarnivalMonday(year): return EasterSunday(year) - 48 Rosenmontag = CarnivalMonday def MardiGras(year): return EasterSunday(year) - 47 def AshWednesday(year): return EasterSunday(year) - 46 Aschermittwoch = AshWednesday MercrediCendres = AshWednesday def PalmSunday(year): return EasterSunday(year) - 7 Palmsonntag = PalmSunday DimancheRameaux = PalmSunday def EasterFriday(year): return EasterSunday(year) - 2 GoodFriday = EasterFriday Karfreitag = EasterFriday VendrediSaint = EasterFriday def EasterMonday(year): return EasterSunday(year) + 1 Ostermontag = EasterMonday LundiPaques = EasterMonday def Ascension(year): return EasterSunday(year) + 39 Himmelfahrt = Ascension def Pentecost(year): return EasterSunday(year) + 49 WhitSunday = Pentecost Pfingstsonntag = WhitSunday DimanchePentecote = WhitSunday def WhitMonday(year): return EasterSunday(year) + 50 Pfingstmontag = WhitMonday LundiPentecote = WhitMonday def TrinitySunday(year): return EasterSunday(year) + 56 def CorpusChristi(year): return EasterSunday(year) + 60 Fronleichnam = CorpusChristi FeteDieu = CorpusChristi def _test(): import ISO,ARPA print 'Easter Sunday for the next few years' for year in range(2000, 2038): easter = EasterSunday(year) mark = easter.month == 4 and easter.day == 6 print 'ISO:',ISO.str(easter),' ARPA:', ARPA.str(easter), ' *' * mark if __name__ == '__main__': _test()