Returns a single week in a string (no newline).
(self, theweek, width, *, highlight_day=None)
| 687 | self.highlight_day = highlight_day |
| 688 | |
| 689 | def formatweek(self, theweek, width, *, highlight_day=None): |
| 690 | """ |
| 691 | Returns a single week in a string (no newline). |
| 692 | """ |
| 693 | if highlight_day: |
| 694 | from _colorize import get_colors |
| 695 | |
| 696 | ansi = get_colors() |
| 697 | highlight = f"{ansi.BLACK}{ansi.BACKGROUND_YELLOW}" |
| 698 | reset = ansi.RESET |
| 699 | else: |
| 700 | highlight = reset = "" |
| 701 | |
| 702 | return ' '.join( |
| 703 | ( |
| 704 | f"{highlight}{self.formatday(d, wd, width)}{reset}" |
| 705 | if d == highlight_day |
| 706 | else self.formatday(d, wd, width) |
| 707 | ) |
| 708 | for (d, wd) in theweek |
| 709 | ) |
| 710 | |
| 711 | def formatmonth(self, theyear, themonth, w=0, l=0): |
| 712 | """ |
no test coverage detected