massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / calendar.pyi
1 import datetime\r
2 import sys\r
3 from time import struct_time\r
4 from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union\r
5 \r
6 \r
7 _LocaleType = Tuple[Optional[str], Optional[str]]\r
8 \r
9 class IllegalMonthError(ValueError):\r
10     def __init__(self, month: int) -> None: ...\r
11     def __str__(self) -> str: ...\r
12 \r
13 class IllegalWeekdayError(ValueError):\r
14     def __init__(self, weekday: int) -> None: ...\r
15     def __str__(self) -> str: ...\r
16 \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
21 \r
22 class Calendar:\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
36 \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
48 \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
58 \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
70         cssclass_today: str\r
71         cssclasses_weekday_head: List[str]\r
72         cssclass_month_head: str\r
73         cssclass_month: str\r
74         cssclass_year: str\r
75         cssclass_year_head: str\r
76 \r
77 if sys.version_info < (3, 0):\r
78     class TimeEncoding:\r
79         def __init__(self, locale: _LocaleType) -> None: ...\r
80         def __enter__(self) -> _LocaleType: ...\r
81         def __exit__(self, *args: Any) -> None: ...\r
82 else:\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
87 \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
92 \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
97 \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
103 \r
104 # Data attributes\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
109 \r
110 # Below constants are not in docs or __all__, but enough people have used them\r
111 # they are now effectively public.\r
112 \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