MCPcopy Index your code
hub / github.com/python/cpython / LocaleHTMLCalendar

Class LocaleHTMLCalendar

Lib/calendar.py:664–681  ·  view source on GitHub ↗

This class can be passed a locale name in the constructor and will return month and weekday names in the specified locale.

Source from the content-addressed store, hash-verified

662
663
664class LocaleHTMLCalendar(HTMLCalendar):
665 """
666 This class can be passed a locale name in the constructor and will return
667 month and weekday names in the specified locale.
668 """
669 def __init__(self, firstweekday=0, locale=None):
670 HTMLCalendar.__init__(self, firstweekday)
671 if locale is None:
672 locale = _get_default_locale()
673 self.locale = locale
674
675 def formatweekday(self, day):
676 with different_locale(self.locale):
677 return super().formatweekday(day)
678
679 def formatmonthname(self, theyear, themonth, withyear=True):
680 with different_locale(self.locale):
681 return super().formatmonthname(theyear, themonth, withyear)
682
683
684class _CLIDemoCalendar(TextCalendar):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…