| 114 | |
| 115 | |
| 116 | class _localized_day: |
| 117 | |
| 118 | # January 1, 2001, was a Monday. |
| 119 | _days = [datetime.date(2001, 1, i+1).strftime for i in range(7)] |
| 120 | |
| 121 | def __init__(self, format): |
| 122 | self.format = format |
| 123 | |
| 124 | def __getitem__(self, i): |
| 125 | funcs = self._days[i] |
| 126 | if isinstance(i, slice): |
| 127 | return [f(self.format) for f in funcs] |
| 128 | else: |
| 129 | return funcs(self.format) |
| 130 | |
| 131 | def __len__(self): |
| 132 | return 7 |
| 133 | |
| 134 | |
| 135 | # Full and abbreviated names of weekdays |
no test coverage detected
searching dependent graphs…