• Home
  • Raw
  • Download

Lines Matching refs:calendar

1 import calendar
382 cal = calendar.HTMLCalendar()
393 self.normalize_calendar(calendar.calendar(2004)),
397 self.normalize_calendar(calendar.calendar(0)),
403 calendar.TextCalendar().formatyear(2004),
407 calendar.TextCalendar().formatyear(0),
426 shrink(calendar.Calendar().yeardatescalendar(2004)),
432 calendar.Calendar().yeardayscalendar(2004),
438 calendar.TextCalendar().formatweekheader(2),
444 calendar.TextCalendar().formatweekheader(9),
451 calendar.TextCalendar().formatmonth(2004, 1),
455 calendar.TextCalendar().formatmonth(0, 2),
461 calendar.HTMLCalendar().formatmonthname(2004, 1, withyear=True),
467 calendar.HTMLCalendar().formatmonthname(2004, 1, withyear=False),
474 calendar.TextCalendar().prweek(week, 1)
479 calendar.TextCalendar().prmonth(2004, 1)
484 calendar.TextCalendar().pryear(2004)
489 calendar.format(["1", "2", "3"], colwidth=3, spacing=1)
498 self.assertEqual(calendar.isleap(2000), 1)
499 self.assertEqual(calendar.isleap(2001), 0)
500 self.assertEqual(calendar.isleap(2002), 0)
501 self.assertEqual(calendar.isleap(2003), 0)
504 self.assertRaises(TypeError, calendar.setfirstweekday, 'flabber')
505 self.assertRaises(ValueError, calendar.setfirstweekday, -1)
506 self.assertRaises(ValueError, calendar.setfirstweekday, 200)
507 orig = calendar.firstweekday()
508 calendar.setfirstweekday(calendar.SUNDAY)
509 self.assertEqual(calendar.firstweekday(), calendar.SUNDAY)
510 calendar.setfirstweekday(calendar.MONDAY)
511 self.assertEqual(calendar.firstweekday(), calendar.MONDAY)
512 calendar.setfirstweekday(orig)
515 with self.assertRaisesRegex(calendar.IllegalWeekdayError, '123'):
516 calendar.setfirstweekday(123)
519 self.assertRaises(IndexError, calendar.day_abbr.__getitem__, -10)
520 self.assertRaises(IndexError, calendar.day_name.__getitem__, 10)
521 self.assertEqual(len([d for d in calendar.day_abbr]), 7)
525 value = getattr(calendar, attr)
535 value = getattr(calendar, attr)
547 old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
549 cal = calendar.LocaleTextCalendar(locale='')
559 cal = calendar.LocaleHTMLCalendar(locale='')
564 new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
569 list(calendar.Calendar().itermonthdays3(datetime.MAXYEAR, 12))
572 cal = calendar.Calendar(firstweekday=3)
579 cal = calendar.Calendar(firstweekday)
585 cal = calendar.Calendar(firstweekday=3)
591 cal = calendar.Calendar(firstweekday)
601 self.oldfirstweekday = calendar.firstweekday()
602 calendar.setfirstweekday(self.firstweekday)
605 calendar.setfirstweekday(self.oldfirstweekday)
608 cal = calendar.monthcalendar(year, month)
615 firstweekday = calendar.MONDAY
673 firstweekday = calendar.SUNDAY
735 self.assertEqual(secs, calendar.timegm(tuple))
740 self.assertEqual(calendar.monthrange(2004,1), (3,31))
744 self.assertEqual(calendar.monthrange(2004,2), (6,29))
748 self.assertEqual(calendar.monthrange(2010,2), (0,28))
752 self.assertEqual(calendar.monthrange(2004,12), (2,31))
756 with self.assertRaises(calendar.IllegalMonthError):
757 calendar.monthrange(2004, 0)
761 with self.assertRaises(calendar.IllegalMonthError):
762 calendar.monthrange(2004, 13)
765 with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
766 calendar.monthrange(2004, 65)
771 self.assertEqual(calendar.leapdays(2010,2010), 0)
775 self.assertEqual(calendar.leapdays(2010,2011), 0)
779 self.assertEqual(calendar.leapdays(2010,2012), 0)
783 self.assertEqual(calendar.leapdays(2012,2013), 1)
786 self.assertEqual(calendar.leapdays(1997,2020), 5)
918 support.check__all__(self, calendar, blacklist=blacklist)
925 class CustomHTMLCal(calendar.HTMLCalendar):
927 calendar.HTMLCalendar.cssclasses]