diff --git a/third_party/2/croniter.pyi b/third_party/2/croniter.pyi deleted file mode 100644 index c164213d7..000000000 --- a/third_party/2/croniter.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Any - -class croniter: - MONTHS_IN_YEAR = ... # type: Any - RANGES = ... # type: Any - DAYS = ... # type: Any - ALPHACONV = ... # type: Any - LOWMAP = ... # type: Any - bad_length = ... # type: Any - tzinfo = ... # type: Any - cur = ... # type: Any - exprs = ... # type: Any - expanded = ... # type: Any - def __init__(self, expr_format, start_time=..., ret_type=...) -> None: ... - def get_next(self, ret_type=...): ... - def get_prev(self, ret_type=...): ... - def get_current(self, ret_type=...): ... - def __iter__(self): ... - __next__ = ... # type: Any - def all_next(self, ret_type=...): ... - def all_prev(self, ret_type=...): ... - iter = ... # type: Any - def is_leap(self, year): ... diff --git a/third_party/2and3/croniter.pyi b/third_party/2and3/croniter.pyi new file mode 100644 index 000000000..0d01b7e05 --- /dev/null +++ b/third_party/2and3/croniter.pyi @@ -0,0 +1,41 @@ +import datetime +from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union + +_RetType = Union[Type[float], Type[datetime.datetime]] +_SelfT = TypeVar('_SelfT', bound=croniter) + +class CroniterError(ValueError): ... +class CroniterBadCronError(CroniterError): ... +class CroniterBadDateError(CroniterError): ... +class CroniterNotAlphaError(CroniterError): ... + +class croniter(Iterator[Any]): + MONTHS_IN_YEAR: int + RANGES: Tuple[Tuple[int, int], ...] + DAYS: Tuple[int, ...] + ALPHACONV: Tuple[Dict[str, Any], ...] + LOWMAP: Tuple[Dict[int, Any], ...] + bad_length: str + tzinfo: Optional[datetime.tzinfo] + cur: float + expanded: List[List[str]] + start_time: float + dst_start_time: float + nth_weekday_of_month: Dict[str, Any] + def __init__(self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...) -> None: ... + # Most return value depend on ret_type, which can be passed in both as a method argument and as + # a constructor argument. + def get_next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_prev(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_current(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def __iter__(self: _SelfT) -> _SelfT: ... + def __next__(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def all_next(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def all_prev(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def iter(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def is_leap(self, year: int) -> bool: ... + @classmethod + def expand(cls, expr_format: Text) -> Tuple[List[List[str]], Dict[str, Any]]: ... + @classmethod + def is_valid(cls, expression: Text) -> bool: ...