3 from time import struct_time
\r
4 from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union
\r
7 _LocaleType = Tuple[Optional[str], Optional[str]]
\r
9 class IllegalMonthError(ValueError):
\r
10 def __init__(self, month: int) -> None: ...
\r
11 def __str__(self) -> str: ...
\r
13 class IllegalWeekdayError(ValueError):
\r
14 def __init__(self, weekday: int) -> None: ...
\r
15 def __str__(self) -> str: ...
\r
17 def isleap(year: int) -> bool: ...
\r
18 def leapdays(y1: int, y2: int) -> int: ...
\r
19 def weekday(year: int, month: int, day: int) -> int: ...
\r
20 def monthrange(year: int, month: int) -> Tuple[int, int]: ...
\r
23 def __init__(self, firstweekday: int = ...) -> None: ...
\r
24 def getfirstweekday(self) -> int: ...
\r
25 def setfirstweekday(self, firstweekday: int) -> None: ...
\r
26 def iterweekdays(self) -> Iterable[int]: ...
\r
27 def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ...
\r
28 def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ...
\r
29 def itermonthdays(self, year: int, month: int) -> Iterable[int]: ...
\r
30 def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ...
\r
31 def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ...
\r
32 def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ...
\r
33 def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ...
\r
34 def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ...
\r
35 def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ...
\r
37 class TextCalendar(Calendar):
\r
38 def prweek(self, theweek: int, width: int) -> None: ...
\r
39 def formatday(self, day: int, weekday: int, width: int) -> str: ...
\r
40 def formatweek(self, theweek: int, width: int) -> str: ...
\r
41 def formatweekday(self, day: int, width: int) -> str: ...
\r
42 def formatweekheader(self, width: int) -> str: ...
\r
43 def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ...
\r
44 def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ...
\r
45 def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ...
\r
46 def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ...
\r
47 def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
\r
49 def firstweekday() -> int: ...
\r
50 def monthcalendar(year: int, month: int) -> List[List[int]]: ...
\r
51 def prweek(theweek: int, width: int) -> None: ...
\r
52 def week(theweek: int, width: int) -> str: ...
\r
53 def weekheader(width: int) -> str: ...
\r
54 def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ...
\r
55 def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ...
\r
56 def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ...
\r
57 def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
\r
59 class HTMLCalendar(Calendar):
\r
60 def formatday(self, day: int, weekday: int) -> str: ...
\r
61 def formatweek(self, theweek: int) -> str: ...
\r
62 def formatweekday(self, day: int) -> str: ...
\r
63 def formatweekheader(self) -> str: ...
\r
64 def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
\r
65 def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
\r
66 def formatyear(self, theyear: int, width: int = ...) -> str: ...
\r
67 def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ...
\r
68 if sys.version_info >= (3, 7):
\r
69 cssclasses: List[str]
\r
71 cssclasses_weekday_head: List[str]
\r
72 cssclass_month_head: str
\r
75 cssclass_year_head: str
\r
77 if sys.version_info < (3, 0):
\r
79 def __init__(self, locale: _LocaleType) -> None: ...
\r
80 def __enter__(self) -> _LocaleType: ...
\r
81 def __exit__(self, *args: Any) -> None: ...
\r
83 class different_locale:
\r
84 def __init__(self, locale: _LocaleType) -> None: ...
\r
85 def __enter__(self) -> _LocaleType: ...
\r
86 def __exit__(self, *args: Any) -> None: ...
\r
88 class LocaleTextCalendar(TextCalendar):
\r
89 def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ...
\r
90 def formatweekday(self, day: int, width: int) -> str: ...
\r
91 def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ...
\r
93 class LocaleHTMLCalendar(HTMLCalendar):
\r
94 def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ...
\r
95 def formatweekday(self, day: int) -> str: ...
\r
96 def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
\r
98 c = ... # type: TextCalendar
\r
99 def setfirstweekday(firstweekday: int) -> None: ...
\r
100 def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
\r
101 def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
\r
102 def timegm(tuple: Union[Tuple[int, ...], struct_time]) -> int: ...
\r
105 day_name = ... # type: Sequence[str]
\r
106 day_abbr = ... # type: Sequence[str]
\r
107 month_name = ... # type: Sequence[str]
\r
108 month_abbr = ... # type: Sequence[str]
\r
110 # Below constants are not in docs or __all__, but enough people have used them
\r
111 # they are now effectively public.
\r
113 MONDAY = ... # type: int
\r
114 TUESDAY = ... # type: int
\r
115 WEDNESDAY = ... # type: int
\r
116 THURSDAY = ... # type: int
\r
117 FRIDAY = ... # type: int
\r
118 SATURDAY = ... # type: int
\r
119 SUNDAY = ... # type: int
\r