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

Method formatweek

Lib/calendar.py:656–676  ·  view source on GitHub ↗

Returns a single week in a string (no newline).

(self, theweek, width, *, highlight_day=None)

Source from the content-addressed store, hash-verified

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 """

Callers 2

formatmonthMethod · 0.95
formatyearMethod · 0.95

Calls 3

get_colorsFunction · 0.90
joinMethod · 0.45
formatdayMethod · 0.45

Tested by

no test coverage detected