Return a month's calendar string (multi-line).
(self, theyear, themonth, w=0, l=0)
| 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 | """ |