MCPcopy Index your code
hub / github.com/RustPython/RustPython / formatmonth

Method formatmonth

Lib/calendar.py:391–405  ·  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

389 print(self.formatmonth(theyear, themonth, w, l), end='')
390
391 def formatmonth(self, theyear, themonth, w=0, l=0):
392 """
393 Return a month's calendar string (multi-line).
394 """
395 w = max(2, w)
396 l = max(1, l)
397 s = self.formatmonthname(theyear, themonth, 7 * (w + 1) - 1)
398 s = s.rstrip()
399 s += '\n' * l
400 s += self.formatweekheader(w).rstrip()
401 s += '\n' * l
402 for week in self.monthdays2calendar(theyear, themonth):
403 s += self.formatweek(week, w).rstrip()
404 s += '\n' * l
405 return s
406
407 def formatyear(self, theyear, w=2, l=1, c=6, m=3):
408 """

Callers 5

prmonthMethod · 0.95
test_formatmonthMethod · 0.45
test_formatmonthMethod · 0.45

Calls 6

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