Always return firstweekday % 7 instead of complaining

on setting.
This commit is contained in:
Walter Dörwald 2006-04-03 15:21:59 +00:00
parent aba10cf153
commit 72d84af401
1 changed files with 1 additions and 3 deletions

View File

@ -131,11 +131,9 @@ class Calendar(object):
self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday
def getfirstweekday(self): def getfirstweekday(self):
return self._firstweekday return self._firstweekday % 7
def setfirstweekday(self, firstweekday): def setfirstweekday(self, firstweekday):
if not MONDAY <= firstweekday <= SUNDAY:
raise IllegalWeekdayError(firstweekday)
self._firstweekday = firstweekday self._firstweekday = firstweekday
firstweekday = property(getfirstweekday, setfirstweekday) firstweekday = property(getfirstweekday, setfirstweekday)