Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
kasium committed Oct 19, 2022
1 parent be3dce2 commit 44bc57f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 85 deletions.
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"stubs/paramiko",
"stubs/prettytable",
"stubs/protobuf",
"stubs/python-crontab",
"stubs/pytz/pytz/lazy.pyi",
"stubs/pytz/pytz/reference.pyi",
"stubs/pytz/pytz/tzfile.pyi",
Expand Down
6 changes: 3 additions & 3 deletions stubs/python-crontab/cronlog.pyi
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from _typeshed import Self
from _typeshed import Self, StrOrBytesPath
from codecs import StreamReaderWriter
from collections.abc import Generator, Iterator
from types import TracebackType

MATCHER: str

class LogReader:
filename: str
filename: StrOrBytesPath
mass: int
size: int
read: int
pipe: StreamReaderWriter | None
def __init__(self, filename: str, mass: int = ...) -> None: ...
def __init__(self, filename: StrOrBytesPath, mass: int = ...) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, error_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
Expand Down
161 changes: 79 additions & 82 deletions stubs/python-crontab/crontab.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re
from _typeshed import Incomplete
import subprocess
from _typeshed import Incomplete, Self
from collections import OrderedDict
from collections.abc import Callable, Generator
from logging import Logger
Expand All @@ -24,10 +25,8 @@ LOG: Logger
CRON_COMMAND: str
SHELL: str
current_user: Callable[[], str | None]
unicode = str
basestring = str

def open_pipe(cmd: str, *args: str, **flags) -> subprocess.Popen: ...
def open_pipe(cmd: str, *args: str, **flags) -> subprocess.Popen[Any]: ...

class CronTab:
lines: Incomplete
Expand All @@ -45,21 +44,19 @@ class CronTab:
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
@property
def log(self) -> Incomplete: ...
def log(self): ...
@property
def user(self) -> str | None: ...
@property
def user_opt(self) -> Incomplete: ...
def user_opt(self): ...
def read(self, filename: Incomplete | None = ...) -> None: ...
def append(self, item: Incomplete, line: str = ..., read: bool = ...) -> None: ...
def append(self, item, line: str = ..., read: bool = ...) -> None: ...
def write(self, filename: Incomplete | None = ..., user: Incomplete | None = ..., errors: bool = ...) -> None: ...
def write_to_user(self, user: bool = ...) -> Incomplete: ...
def write_to_user(self, user: bool = ...): ...
def run_pending(self, **kwargs) -> Generator[Incomplete, None, None]: ...
def run_scheduler(self, timeout: int = ..., **kwargs) -> Generator[Incomplete, None, None]: ...
def render(self, errors: bool = ..., specials: bool = ...) -> Incomplete: ...
def new(
self, command: str = ..., comment: str = ..., user: Incomplete | None = ..., pre_comment: bool = ...
) -> CronItem: ...
def render(self, errors: bool = ..., specials: bool = ...): ...
def new(self, command: str = ..., comment: str = ..., user: Incomplete | None = ..., pre_comment: bool = ...) -> CronItem: ...
def find_command(self, command) -> Generator[Incomplete, None, None]: ...
def find_comment(self, comment) -> Generator[Incomplete, None, None]: ...
def find_time(self, *args) -> Generator[Incomplete, None, None]: ...
Expand All @@ -69,9 +66,9 @@ class CronTab:
def comments(self) -> Generator[Incomplete, None, None]: ...
def remove_all(self, *args, **kwargs): ...
def remove(self, *items): ...
def __iter__(self) -> Incomplete: ...
def __getitem__(self, i: Incomplete) -> Incomplete: ...
def __unicode__(self) -> Incomplete: ...
def __iter__(self): ...
def __getitem__(self, i): ...
def __unicode__(self) -> str: ...
def __len__(self) -> int: ...

class CronItem:
Expand All @@ -98,135 +95,135 @@ class CronItem:
def delete(self) -> None: ...
def set_command(self, cmd: str, parse_stdin: bool = ...) -> None: ...
def set_comment(self, cmt: str, pre_comment: bool = ...) -> None: ...
def parse(self, line: Incomplete) -> None: ...
def parse(self, line) -> None: ...
def enable(self, enabled: bool = ...) -> bool: ...
def is_enabled(self) -> bool: ...
def is_valid(self) -> bool: ...
def render(self, specials: bool = ...) -> str: ...
def every_reboot(self) -> Incomplete: ...
def every(self, unit: int = ...) -> Incomplete: ...
def setall(self, *args: Any) -> Incomplete: ...
def clear(self) -> Incomplete: ...
def frequency(self, year: Incomplete | None = ...) -> Incomplete: ...
def frequency_per_year(self, year: Incomplete | None = ...) -> Incomplete: ...
def frequency_per_day(self) -> Incomplete: ...
def frequency_per_hour(self) -> Incomplete: ...
def run_pending(self, now: Incomplete | None = ...) -> Incomplete: ...
def run(self) -> Incomplete: ...
def schedule(self, date_from: Incomplete | None = ...) -> Incomplete: ...
def description(self, **kw: Any) -> Incomplete: ...
def every_reboot(self): ...
def every(self, unit: int = ...): ...
def setall(self, *args: Any): ...
def clear(self): ...
def frequency(self, year: Incomplete | None = ...): ...
def frequency_per_year(self, year: Incomplete | None = ...): ...
def frequency_per_day(self): ...
def frequency_per_hour(self): ...
def run_pending(self, now: Incomplete | None = ...): ...
def run(self): ...
def schedule(self, date_from: Incomplete | None = ...): ...
def description(self, **kw: Any): ...
@property
def log(self) -> Incomplete: ...
def log(self): ...
@property
def minute(self) -> Incomplete: ...
def minute(self): ...
@property
def minutes(self) -> Incomplete: ...
def minutes(self): ...
@property
def hour(self) -> Incomplete: ...
def hour(self): ...
@property
def hours(self) -> Incomplete: ...
def hours(self): ...
@property
def day(self) -> Incomplete: ...
def day(self): ...
@property
def dom(self) -> Incomplete: ...
def dom(self): ...
@property
def month(self) -> Incomplete: ...
def month(self): ...
@property
def months(self) -> Incomplete: ...
def months(self): ...
@property
def dow(self) -> Incomplete: ...
def __len__(self) -> Incomplete: ...
def __getitem__(self, key: str) -> Incomplete: ...
def __lt__(self, value: Incomplete) -> Incomplete: ...
def __gt__(self, value: Incomplete) -> Incomplete: ...
def __unicode__(self) -> Incomplete: ...
def dow(self): ...
def __len__(self) -> int: ...
def __getitem__(self, key: str): ...
def __lt__(self, value): ...
def __gt__(self, value): ...
def __unicode__(self) -> str: ...

class Every:
slices: Incomplete
unit: Incomplete
def __init__(self, item: Incomplete, units: Incomplete) -> None: ...
def __init__(self, item, units) -> None: ...
def set_attr(self, target: int) -> Callable[[], None]: ...
def year(self) -> None: ...

class CronSlices(list[CronSlice]):
special: Incomplete
def __init__(self, *args: Any) -> None: ...
def is_self_valid(self, *args: Any) -> Incomplete: ...
def is_self_valid(self, *args: Any) -> bool: ...
@classmethod
def is_valid(cls, *args: Any) -> Incomplete: ...
def setall(self, *slices: Incomplete) -> None: ...
def is_valid(cls, *args: Any) -> bool: ...
def setall(self, *slices) -> None: ...
def clean_render(self) -> str: ...
def render(self, specials: bool = ...) -> str: ...
def clear(self) -> None: ...
def frequency(self, year: Incomplete | None = ...) -> Incomplete: ...
def frequency_per_year(self, year: Incomplete | None = ...) -> Incomplete: ...
def frequency_per_day(self) -> Incomplete: ...
def frequency_per_hour(self) -> Incomplete: ...
def frequency(self, year: Incomplete | None = ...): ...
def frequency_per_year(self, year: Incomplete | None = ...): ...
def frequency_per_day(self): ...
def frequency_per_hour(self): ...
def __eq__(self, arg: object) -> bool: ...

class SundayError(KeyError): ...

class Also:
obj: Incomplete
def __init__(self, obj: Incomplete) -> None: ...
def every(self, *a: Incomplete) -> Incomplete: ...
def on(self, *a: Incomplete) -> Incomplete: ...
def during(self, *a: Incomplete) -> Incomplete: ...
def __init__(self, obj) -> None: ...
def every(self, *a): ...
def on(self, *a): ...
def during(self, *a): ...

class CronSlice:
min: Incomplete
max: Incomplete
name: Incomplete
enum: Incomplete
parts: Incomplete
def __init__(self, info: Incomplete, value: Incomplete | None = ...) -> None: ...
def __hash__(self) -> Incomplete: ...
def parse(self, value: Incomplete) -> None: ...
def render(self, resolve: bool = ..., specials: bool = ...) -> Incomplete: ...
def __init__(self, info, value: Incomplete | None = ...) -> None: ...
def __hash__(self) -> int: ...
def parse(self, value) -> None: ...
def render(self, resolve: bool = ..., specials: bool = ...): ...
def __eq__(self, arg: object) -> bool: ...
def __unicode__(self) -> Incomplete: ...
def every(self, n_value: Incomplete, also: bool = ...) -> Incomplete: ...
def on(self, *n_value: Incomplete, **opts: Incomplete) -> Incomplete: ...
def during(self, vfrom: Incomplete, vto: Incomplete, also: bool = ...) -> Incomplete: ...
def __unicode__(self) -> str: ...
def every(self, n_value, also: bool = ...): ...
def on(self, *n_value, **opts): ...
def during(self, vfrom, vto, also: bool = ...): ...
@property
def also(self) -> Incomplete: ...
def also(self): ...
def clear(self) -> None: ...
def get_range(self, *vrange: Incomplete) -> Incomplete: ...
def __iter__(self) -> Incomplete: ...
def __len__(self) -> Incomplete: ...
def parse_value(self, val: Incomplete, sunday: Incomplete | None = ...) -> Incomplete: ...
def get_range(self, *vrange): ...
def __iter__(self): ...
def __len__(self) -> int: ...
def parse_value(self, val, sunday: Incomplete | None = ...): ...

def get_cronvalue(value: Incomplete, enums: Incomplete) -> Incomplete: ...
def get_cronvalue(value, enums): ...

class CronValue:
text: Incomplete
value: Incomplete
def __init__(self, value: Incomplete, enums: Incomplete) -> None: ...
def __lt__(self, value: Incomplete) -> Incomplete: ...
def __init__(self, value, enums) -> None: ...
def __lt__(self, value): ...
def __int__(self) -> int: ...

class CronRange:
dangling: Incomplete
slice: Incomplete
cron: Incomplete
seq: int
def __init__(self, vslice: Incomplete, *vrange: Incomplete) -> None: ...
def __init__(self, vslice, *vrange) -> None: ...
vfrom: Incomplete
vto: Incomplete
def parse(self, value: Incomplete) -> None: ...
def parse(self, value) -> None: ...
def all(self) -> None: ...
def render(self, resolve: bool = ...) -> Incomplete: ...
def range(self) -> Incomplete: ...
def every(self, value: Incomplete) -> None: ...
def __lt__(self, value: Incomplete) -> Incomplete: ...
def __gt__(self, value: Incomplete) -> Incomplete: ...
def render(self, resolve: bool = ...): ...
def range(self): ...
def every(self, value) -> None: ...
def __lt__(self, value): ...
def __gt__(self, value): ...
def __int__(self) -> int: ...
def __unicode__(self) -> Incomplete: ...
def __unicode__(self) -> str: ...

class OrderedVariableList(OrderedDict[Incomplete, Incomplete]):
job: Incomplete
def __init__(self, *args: Any, **kw: Any) -> None: ...
@property
def previous(self) -> Incomplete: ...
def all(self) -> Incomplete: ...
def __getitem__(self, key: Incomplete) -> Incomplete: ...
def previous(self): ...
def all(self): ...
def __getitem__(self, key): ...

0 comments on commit 44bc57f

Please sign in to comment.