Returns a single week in a string (no newline).
(self, theweek, width, *, highlight_day=None)
| 654 | self.highlight_day = highlight_day |
| 655 | |
| 656 | def formatweek(self, theweek, width, *, highlight_day=None): |
| 657 | """ |
| 658 | Returns a single week in a string (no newline). |
| 659 | """ |
| 660 | if highlight_day: |
| 661 | from _colorize import get_colors |
| 662 | |
| 663 | ansi = get_colors() |
| 664 | highlight = f"{ansi.BLACK}{ansi.BACKGROUND_YELLOW}" |
| 665 | reset = ansi.RESET |
| 666 | else: |
| 667 | highlight = reset = "" |
| 668 | |
| 669 | return ' '.join( |
| 670 | ( |
| 671 | f"{highlight}{self.formatday(d, wd, width)}{reset}" |
| 672 | if d == highlight_day |
| 673 | else self.formatday(d, wd, width) |
| 674 | ) |
| 675 | for (d, wd) in theweek |
| 676 | ) |
| 677 | |
| 678 | def formatmonth(self, theyear, themonth, w=0, l=0): |
| 679 | """ |
no test coverage detected