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

Method formatmonth

Lib/calendar.py:410–424  ·  view source on GitHub ↗

Return a month's calendar string (multi-line).

(self, theyear, themonth, w=0, l=0)

Source from the content-addressed store, hash-verified

408 print(self.formatmonth(theyear, themonth, w, l), end='')
409
410 def formatmonth(self, theyear, themonth, w=0, l=0):
411 """
412 Return a month's calendar string (multi-line).
413 """
414 w = max(2, w)
415 l = max(1, l)
416 s = self.formatmonthname(theyear, themonth, 7 * (w + 1) - 1)
417 s = s.rstrip()
418 s += '\n' * l
419 s += self.formatweekheader(w).rstrip()
420 s += '\n' * l
421 for week in self.monthdays2calendar(theyear, themonth):
422 s += self.formatweek(week, w).rstrip()
423 s += '\n' * l
424 return s
425
426 def formatyear(self, theyear, w=2, l=1, c=6, m=3):
427 """

Callers 5

prmonthMethod · 0.95
test_formatmonthMethod · 0.45
test_formatmonthMethod · 0.45

Calls 5

formatmonthnameMethod · 0.95
formatweekheaderMethod · 0.95
formatweekMethod · 0.95
monthdays2calendarMethod · 0.80
rstripMethod · 0.45