apply black and isort (#4287)

* apply black and isort

* move some type ignores
This commit is contained in:
Jelle Zijlstra
2020-06-28 13:31:00 -07:00
committed by GitHub
parent fe58699ca5
commit 5d553c9584
800 changed files with 13875 additions and 10332 deletions

View File

@@ -1,9 +1,9 @@
# Stubs for OpenSSL.crypto (Python 2)
from datetime import datetime
from typing import Any, Callable, Iterable, List, Optional, Set, Text, Tuple, Union
from cryptography.hazmat.primitives.asymmetric import dsa, rsa
from datetime import datetime
FILETYPE_PEM: int
FILETYPE_ASN1: int
@@ -51,8 +51,9 @@ class X509Name:
def get_components(self) -> List[Tuple[str, str]]: ...
class X509Extension:
def __init__(self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ...,
issuer: Optional[X509] = ...) -> None: ...
def __init__(
self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ..., issuer: Optional[X509] = ...
) -> None: ...
def get_critical(self) -> bool: ...
def get_short_name(self) -> str: ...
def get_data(self) -> str: ...
@@ -128,8 +129,9 @@ class X509StoreContext:
def load_certificate(type: int, buffer: Union[str, unicode]) -> X509: ...
def dump_certificate(type: int, cert: X509) -> bytes: ...
def dump_publickey(type: int, pkey: PKey) -> bytes: ...
def dump_privatekey(type: int, pkey: PKey, cipher: Optional[str] = ...,
passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> bytes: ...
def dump_privatekey(
type: int, pkey: PKey, cipher: Optional[str] = ..., passphrase: Optional[Union[str, Callable[[int], int]]] = ...
) -> bytes: ...
class Revoked:
def __init__(self) -> None: ...

View File

@@ -1,18 +1,20 @@
import sys
from ._base import (
ALL_COMPLETED as ALL_COMPLETED,
FIRST_COMPLETED as FIRST_COMPLETED,
FIRST_EXCEPTION as FIRST_EXCEPTION,
ALL_COMPLETED as ALL_COMPLETED,
CancelledError as CancelledError,
TimeoutError as TimeoutError,
Future as Future,
Executor as Executor,
wait as wait,
Future as Future,
TimeoutError as TimeoutError,
as_completed as as_completed,
wait as wait,
)
from .process import ProcessPoolExecutor as ProcessPoolExecutor
from .thread import ThreadPoolExecutor as ThreadPoolExecutor
if sys.version_info >= (3, 8):
from ._base import InvalidStateError as InvalidStateError
if sys.version_info >= (3, 7):
from ._base import BrokenExecutor as BrokenExecutor
from .thread import ThreadPoolExecutor as ThreadPoolExecutor
from .process import ProcessPoolExecutor as ProcessPoolExecutor

View File

@@ -1,8 +1,8 @@
import sys
import threading
from logging import Logger
from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, List
from types import TracebackType
import sys
from typing import Any, Callable, Generic, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar
FIRST_COMPLETED: str
FIRST_EXCEPTION: str
@@ -17,13 +17,14 @@ LOGGER: Logger
class Error(Exception): ...
class CancelledError(Error): ...
class TimeoutError(Error): ...
if sys.version_info >= (3, 8):
class InvalidStateError(Error): ...
if sys.version_info >= (3, 7):
class BrokenExecutor(RuntimeError): ...
_T = TypeVar('_T')
_T = TypeVar("_T")
class Future(Generic[_T]):
def __init__(self) -> None: ...
@@ -35,7 +36,6 @@ class Future(Generic[_T]):
def result(self, timeout: Optional[float] = ...) -> _T: ...
def set_running_or_notify_cancel(self) -> bool: ...
def set_result(self, result: _T) -> None: ...
if sys.version_info >= (3,):
def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ...
def set_exception(self, exception: Optional[BaseException]) -> None: ...
@@ -45,12 +45,12 @@ class Future(Generic[_T]):
def set_exception(self, exception: Any) -> None: ...
def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ...
class Executor:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
if sys.version_info >= (3, 5):
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,
chunksize: int = ...) -> Iterator[_T]: ...
def map(
self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...
) -> Iterator[_T]: ...
else:
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ...
def shutdown(self, wait: bool = ...) -> None: ...
@@ -58,9 +58,9 @@ class Executor:
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ...
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...
def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]],
Set[Future[_T]]]: ...
def wait(
fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...
) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ...
class _Waiter:
event: threading.Event
@@ -70,7 +70,6 @@ class _Waiter:
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _AsCompletedWaiter(_Waiter):
lock: threading.Lock
def __init__(self) -> None: ...
@@ -78,13 +77,11 @@ class _AsCompletedWaiter(_Waiter):
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _FirstCompletedWaiter(_Waiter):
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _AllCompletedWaiter(_Waiter):
num_pending_calls: int
stop_on_exception: bool
@@ -94,7 +91,6 @@ class _AllCompletedWaiter(_Waiter):
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...
class _AcquireFutures:
futures: Iterable[Future[Any]]
def __init__(self, futures: Iterable[Future[Any]]) -> None: ...

View File

@@ -1,23 +1,28 @@
from typing import Any, Callable, Optional, Tuple
from ._base import Executor
import sys
from typing import Any, Callable, Optional, Tuple
from ._base import Executor
EXTRA_QUEUED_CALLS: Any
if sys.version_info >= (3, 7):
from ._base import BrokenExecutor
class BrokenProcessPool(BrokenExecutor): ...
elif sys.version_info >= (3,):
class BrokenProcessPool(RuntimeError): ...
if sys.version_info >= (3, 7):
from multiprocessing.context import BaseContext
class ProcessPoolExecutor(Executor):
def __init__(self, max_workers: Optional[int] = ...,
mp_context: Optional[BaseContext] = ...,
initializer: Optional[Callable[..., None]] = ...,
initargs: Tuple[Any, ...] = ...) -> None: ...
def __init__(
self,
max_workers: Optional[int] = ...,
mp_context: Optional[BaseContext] = ...,
initializer: Optional[Callable[..., None]] = ...,
initargs: Tuple[Any, ...] = ...,
) -> None: ...
else:
class ProcessPoolExecutor(Executor):
def __init__(self, max_workers: Optional[int] = ...) -> None: ...

View File

@@ -1,26 +1,28 @@
from typing import Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Generic
from ._base import Executor, Future
import sys
from typing import Any, Callable, Generic, Iterable, Mapping, Optional, Tuple, TypeVar
from ._base import Executor, Future
if sys.version_info >= (3, 7):
from ._base import BrokenExecutor
class BrokenThreadPool(BrokenExecutor): ...
_S = TypeVar('_S')
_S = TypeVar("_S")
class ThreadPoolExecutor(Executor):
if sys.version_info >= (3, 7):
def __init__(self, max_workers: Optional[int] = ...,
thread_name_prefix: str = ...,
initializer: Optional[Callable[..., None]] = ...,
initargs: Tuple[Any, ...] = ...) -> None: ...
def __init__(
self,
max_workers: Optional[int] = ...,
thread_name_prefix: str = ...,
initializer: Optional[Callable[..., None]] = ...,
initargs: Tuple[Any, ...] = ...,
) -> None: ...
elif sys.version_info >= (3, 6) or sys.version_info < (3,):
def __init__(self, max_workers: Optional[int] = ...,
thread_name_prefix: str = ...) -> None: ...
def __init__(self, max_workers: Optional[int] = ..., thread_name_prefix: str = ...) -> None: ...
else:
def __init__(self, max_workers: Optional[int] = ...) -> None: ...
class _WorkItem(Generic[_S]):
future: Future[_S]
fn: Callable[..., _S]

View File

@@ -1,10 +1,10 @@
# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent!
import sys
from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union
from abc import ABCMeta
from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union
_T = TypeVar('_T')
_S = TypeVar('_S', bound=Type[Enum])
_T = TypeVar("_T")
_S = TypeVar("_S", bound=Type[Enum])
# Note: EnumMeta actually subclasses type directly, not ABCMeta.
# This is a temporary workaround to allow multiple creation of enums with builtins
@@ -56,7 +56,6 @@ if sys.version_info >= (3, 6):
# subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto()
class auto(IntFlag):
value: Any
class Flag(Enum):
def __contains__(self: _T, other: _T) -> bool: ...
def __repr__(self) -> str: ...
@@ -66,7 +65,6 @@ if sys.version_info >= (3, 6):
def __and__(self: _T, other: _T) -> _T: ...
def __xor__(self: _T, other: _T) -> _T: ...
def __invert__(self: _T) -> _T: ...
class IntFlag(int, Flag):
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
def __and__(self: _T, other: Union[int, _T]) -> _T: ...

View File

@@ -1,4 +1,5 @@
from typing import Any
from thrift.Thrift import TProcessor # type: ignore
fastbinary: Any

View File

@@ -1,7 +1,5 @@
from typing import (Any, Container, Generic, Iterable, Iterator, Optional,
overload, SupportsInt, Text, Tuple, TypeVar)
import sys
from typing import Any, Container, Generic, Iterable, Iterator, Optional, SupportsInt, Text, Tuple, TypeVar, overload
# Undocumented length constants
IPV4LENGTH: int

View File

@@ -34,8 +34,21 @@ class KazooClient:
SetPartitioner: Any
Semaphore: Any
ShallowParty: Any
def __init__(self, hosts=..., timeout=..., client_id=..., handler=..., default_acl=..., auth_data=..., read_only=...,
randomize_hosts=..., connection_retry=..., command_retry=..., logger=..., **kwargs) -> None: ...
def __init__(
self,
hosts=...,
timeout=...,
client_id=...,
handler=...,
default_acl=...,
auth_data=...,
read_only=...,
randomize_hosts=...,
connection_retry=...,
command_retry=...,
logger=...,
**kwargs,
) -> None: ...
@property
def client_state(self): ...
@property
@@ -93,5 +106,4 @@ class TransactionRequest:
def __enter__(self): ...
def __exit__(self, exc_type, exc_value, exc_tb): ...
class KazooState:
...
class KazooState: ...

View File

@@ -1,11 +1,11 @@
from _typeshed import OpenBinaryMode, OpenTextMode
from typing import (Any, BinaryIO, Generator, IO, List, Optional, Sequence,
TextIO, Tuple, Type, TypeVar, Union, overload)
from types import TracebackType
import os
import sys
from types import TracebackType
from typing import IO, Any, BinaryIO, Generator, List, Optional, Sequence, TextIO, Tuple, Type, TypeVar, Union, overload
_P = TypeVar('_P', bound=PurePath)
from _typeshed import OpenBinaryMode, OpenTextMode
_P = TypeVar("_P", bound=PurePath)
if sys.version_info >= (3, 6):
_PurePathBase = os.PathLike[str]
@@ -60,7 +60,6 @@ class PurePath(_PurePathBase):
def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ...
else:
def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ...
@property
def parents(self: _P) -> Sequence[_P]: ...
@property
@@ -71,9 +70,9 @@ class PureWindowsPath(PurePath): ...
class Path(PurePath):
def __enter__(self) -> Path: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[TracebackType]
) -> Optional[bool]: ...
@classmethod
def cwd(cls: Type[_P]) -> _P: ...
def stat(self) -> os.stat_result: ...
@@ -94,20 +93,31 @@ class Path(PurePath):
def lchmod(self, mode: int) -> None: ...
def lstat(self) -> os.stat_result: ...
if sys.version_info < (3, 5):
def mkdir(self, mode: int = ...,
parents: bool = ...) -> None: ...
def mkdir(self, mode: int = ..., parents: bool = ...) -> None: ...
else:
def mkdir(self, mode: int = ..., parents: bool = ...,
exist_ok: bool = ...) -> None: ...
def mkdir(self, mode: int = ..., parents: bool = ..., exist_ok: bool = ...) -> None: ...
@overload
def open(self, mode: OpenTextMode = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...,
newline: Optional[str] = ...) -> TextIO: ...
def open(
self,
mode: OpenTextMode = ...,
buffering: int = ...,
encoding: Optional[str] = ...,
errors: Optional[str] = ...,
newline: Optional[str] = ...,
) -> TextIO: ...
@overload
def open(self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ...,
newline: None = ...) -> BinaryIO: ...
def open(
self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ...
) -> BinaryIO: ...
@overload
def open(self, mode: str, buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...,
newline: Optional[str] = ...) -> IO[Any]: ...
def open(
self,
mode: str,
buffering: int = ...,
encoding: Optional[str] = ...,
errors: Optional[str] = ...,
newline: Optional[str] = ...,
) -> IO[Any]: ...
def owner(self) -> str: ...
if sys.version_info >= (3, 9):
def readlink(self: _P) -> _P: ...
@@ -123,36 +133,28 @@ class Path(PurePath):
def resolve(self: _P, strict: bool = ...) -> _P: ...
def rglob(self, pattern: str) -> Generator[Path, None, None]: ...
def rmdir(self) -> None: ...
def symlink_to(self, target: Union[str, Path],
target_is_directory: bool = ...) -> None: ...
def symlink_to(self, target: Union[str, Path], target_is_directory: bool = ...) -> None: ...
def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ...
if sys.version_info >= (3, 8):
def unlink(self, missing_ok: bool = ...) -> None: ...
else:
def unlink(self) -> None: ...
if sys.version_info >= (3, 5):
@classmethod
def home(cls: Type[_P]) -> _P: ...
if sys.version_info < (3, 6):
def __new__(cls: Type[_P], *args: Union[str, PurePath],
**kwargs: Any) -> _P: ...
def __new__(cls: Type[_P], *args: Union[str, PurePath], **kwargs: Any) -> _P: ...
else:
def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]],
**kwargs: Any) -> _P: ...
def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], **kwargs: Any) -> _P: ...
def absolute(self: _P) -> _P: ...
def expanduser(self: _P) -> _P: ...
def read_bytes(self) -> bytes: ...
def read_text(self, encoding: Optional[str] = ...,
errors: Optional[str] = ...) -> str: ...
def read_text(self, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ...
def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ...
def write_bytes(self, data: bytes) -> int: ...
def write_text(self, data: str, encoding: Optional[str] = ...,
errors: Optional[str] = ...) -> int: ...
def write_text(self, data: str, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> int: ...
if sys.version_info >= (3, 8):
def link_to(self, target: Union[str, bytes, os.PathLike[str]]) -> None: ...
class PosixPath(Path, PurePosixPath): ...
class WindowsPath(Path, PureWindowsPath): ...

View File

@@ -1,13 +1,11 @@
from datetime import datetime, date, time
from typing import Any, Dict, Tuple, Iterable, List, Optional, Union, Sequence
from datetime import date, datetime, time
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Union
Scalar = Union[int, float, str, datetime, date, time]
Result = Union[Tuple[Scalar, ...], Dict[str, Scalar]]
class Connection(object):
def __init__(self, user, password, host, database, timeout,
login_timeout, charset, as_dict) -> None: ...
def __init__(self, user, password, host, database, timeout, login_timeout, charset, as_dict) -> None: ...
def autocommit(self, status: bool) -> None: ...
def close(self) -> None: ...
def commit(self) -> None: ...
@@ -20,29 +18,27 @@ class Cursor(object):
def __next__(self) -> Any: ...
def callproc(self, procname: str, **kwargs) -> None: ...
def close(self) -> None: ...
def execute(self, stmt: str,
params: Optional[Union[Scalar, Tuple[Scalar, ...],
Dict[str, Scalar]]]) -> None: ...
def executemany(self, stmt: str,
params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ...
def execute(self, stmt: str, params: Optional[Union[Scalar, Tuple[Scalar, ...], Dict[str, Scalar]]]) -> None: ...
def executemany(self, stmt: str, params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ...
def fetchall(self) -> List[Result]: ...
def fetchmany(self, size: Optional[int]) -> List[Result]: ...
def fetchone(self) -> Result: ...
def connect(server: Optional[str],
user: Optional[str],
password: Optional[str],
database: Optional[str],
timeout: Optional[int],
login_timeout: Optional[int],
charset: Optional[str],
as_dict: Optional[bool],
host: Optional[str],
appname: Optional[str],
port: Optional[str],
conn_properties: Optional[Union[str, Sequence[str]]],
autocommit: Optional[bool],
tds_version: Optional[str]) -> Connection: ...
def connect(
server: Optional[str],
user: Optional[str],
password: Optional[str],
database: Optional[str],
timeout: Optional[int],
login_timeout: Optional[int],
charset: Optional[str],
as_dict: Optional[bool],
host: Optional[str],
appname: Optional[str],
port: Optional[str],
conn_properties: Optional[Union[str, Sequence[str]]],
autocommit: Optional[bool],
tds_version: Optional[str],
) -> Connection: ...
def get_max_connections() -> int: ...
def set_max_connections(n: int) -> None: ...

View File

@@ -1,5 +1,4 @@
from . import mapper
from . import util
from . import mapper, util
class _RequestConfig:
def __getattr__(self, name): ...

View File

@@ -7,8 +7,18 @@ def strip_slashes(name): ...
class SubMapperParent:
def submapper(self, **kargs): ...
def collection(self, collection_name, resource_name, path_prefix=..., member_prefix=..., controller=...,
collection_actions=..., member_actions=..., member_options=..., **kwargs): ...
def collection(
self,
collection_name,
resource_name,
path_prefix=...,
member_prefix=...,
controller=...,
collection_actions=...,
member_actions=...,
member_options=...,
**kwargs,
): ...
class SubMapper(SubMapperParent):
kwargs: Any

View File

@@ -1,9 +1,10 @@
from typing import Any
import fb303.FacebookService
from .ttypes import * # noqa: F403
from thrift.Thrift import TProcessor # type: ignore # We don't have thrift stubs in typeshed
from .ttypes import * # noqa: F403
class Iface(fb303.FacebookService.Iface):
def Log(self, messages): ...

View File

@@ -1,22 +1,37 @@
from __future__ import print_function
import types
from typing import (
Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional,
Pattern, Text, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView,
)
import typing
import unittest
from __builtin__ import unichr as unichr
from StringIO import StringIO as StringIO, StringIO as BytesIO
from functools import wraps as wraps
from StringIO import StringIO as BytesIO
from typing import (
Any,
AnyStr,
Callable,
Dict,
ItemsView,
Iterable,
KeysView,
Mapping,
NoReturn,
Optional,
Pattern,
Text,
Tuple,
Type,
TypeVar,
Union,
ValuesView,
overload,
)
from . import moves
_T = TypeVar('_T')
_K = TypeVar('_K')
_V = TypeVar('_V')
_T = TypeVar("_T")
_K = TypeVar("_K")
_V = TypeVar("_V")
__version__: str
@@ -35,10 +50,10 @@ binary_type = str
MAXSIZE: int
def advance_iterator(it: typing.Iterator[_T]) -> _T: ...
next = advance_iterator
def callable(obj: object) -> bool: ...
def get_unbound_function(unbound: types.MethodType) -> types.FunctionType: ...
def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ...
def create_unbound_method(func: types.FunctionType, cls: Union[type, types.ClassType]) -> types.MethodType: ...
@@ -52,33 +67,34 @@ def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell,
def get_function_code(fun: types.FunctionType) -> types.CodeType: ...
def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ...
def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ...
def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ...
def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ...
def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ...
# def iterlists
def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ...
def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ...
def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ...
def b(s: str) -> binary_type: ...
def u(s: str) -> text_type: ...
int2byte = chr
def byte2int(bs: binary_type) -> int: ...
def indexbytes(buf: binary_type, i: int) -> int: ...
def iterbytes(buf: binary_type) -> typing.Iterator[int]: ...
def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: str = ...) -> None: ...
@overload
def assertRaisesRegex(self: unittest.TestCase, msg: str = ...) -> Any: ...
@overload
def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ...
def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]],
msg: str = ...) -> None: ...
def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException],
tb: Optional[types.TracebackType] = ...) -> NoReturn: ...
def assertRegex(
self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: str = ...
) -> None: ...
def reraise(
tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...
) -> NoReturn: ...
def exec_(_code_: Union[unicode, types.CodeType], _globs_: Dict[str, Any] = ..., _locs_: Dict[str, Any] = ...): ...
def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ...
@@ -104,7 +120,9 @@ class MovedModule(_LazyDescriptor):
class MovedAttribute(_LazyDescriptor):
mod: str
attr: str
def __init__(self, name: str, old_mod: str, new_mod: str, old_attr: Optional[str] = ..., new_attr: Optional[str] = ...) -> None: ...
def __init__(
self, name: str, old_mod: str, new_mod: str, old_attr: Optional[str] = ..., new_attr: Optional[str] = ...
) -> None: ...
def add_move(move: Union[MovedModule, MovedAttribute]) -> None: ...
def remove_move(name: str) -> None: ...

View File

@@ -2,47 +2,17 @@
#
# Note: Commented out items means they weren't implemented at the time.
# Uncomment them when the modules have been added to the typeshed.
import __builtin__ as builtins
from __builtin__ import intern as intern, raw_input as input, reduce as reduce, reload as reload_module, xrange as xrange
from cStringIO import StringIO as cStringIO
from itertools import ifilter as filter
from itertools import ifilterfalse as filterfalse
from __builtin__ import raw_input as input
from __builtin__ import intern as intern
from itertools import imap as map
from os import getcwdu as getcwd
from os import getcwd as getcwdb
from __builtin__ import xrange as range
from __builtin__ import reload as reload_module
from __builtin__ import reduce as reduce
from itertools import ifilter as filter, ifilterfalse as filterfalse, imap as map, izip as zip, izip_longest as zip_longest
from os import getcwd as getcwdb, getcwdu as getcwd
from pipes import quote as shlex_quote
from StringIO import StringIO as StringIO
from UserDict import UserDict as UserDict
from UserList import UserList as UserList
from UserString import UserString as UserString
from __builtin__ import xrange as xrange
from itertools import izip as zip
from itertools import izip_longest as zip_longest
import __builtin__ as builtins
from . import configparser
# import copy_reg as copyreg
# import gdbm as dbm_gnu
from . import _dummy_thread
from . import http_cookiejar
from . import http_cookies
from . import html_entities
from . import html_parser
from . import http_client
# import email.MIMEMultipart as email_mime_multipart
# import email.MIMENonMultipart as email_mime_nonmultipart
from . import email_mime_text
# import email.MIMEBase as email_mime_base
from . import BaseHTTPServer
from . import CGIHTTPServer
from . import SimpleHTTPServer
from . import cPickle
from . import queue
from . import reprlib
from . import socketserver
from . import _thread
# import Tkinter as tkinter
# import Dialog as tkinter_dialog
# import FileDialog as tkinter_filedialog
@@ -58,9 +28,33 @@ from . import _thread
# import tkFont as tkinter_font
# import tkMessageBox as tkinter_messagebox
# import tkSimpleDialog as tkinter_tksimpledialog
from . import urllib_parse
from . import urllib_error
from . import urllib
from . import urllib_robotparser
from . import xmlrpc_client
# import email.MIMEBase as email_mime_base
# import email.MIMEMultipart as email_mime_multipart
# import email.MIMENonMultipart as email_mime_nonmultipart
# import copy_reg as copyreg
# import gdbm as dbm_gnu
from . import (
BaseHTTPServer,
CGIHTTPServer,
SimpleHTTPServer,
_dummy_thread,
_thread,
configparser,
cPickle,
email_mime_text,
html_entities,
html_parser,
http_client,
http_cookiejar,
http_cookies,
queue,
reprlib,
socketserver,
urllib,
urllib_error,
urllib_parse,
urllib_robotparser,
xmlrpc_client,
)
# import SimpleXMLRPCServer as xmlrpc_server

View File

@@ -1,3 +1,2 @@
from urllib2 import URLError as URLError
from urllib2 import HTTPError as HTTPError
from urllib import ContentTooShortError as ContentTooShortError
from urllib2 import HTTPError as HTTPError, URLError as URLError

View File

@@ -1,25 +1,28 @@
# Stubs for six.moves.urllib.parse
from urlparse import ParseResult as ParseResult
from urlparse import SplitResult as SplitResult
from urlparse import parse_qs as parse_qs
from urlparse import parse_qsl as parse_qsl
from urlparse import urldefrag as urldefrag
from urlparse import urljoin as urljoin
from urlparse import urlparse as urlparse
from urlparse import urlsplit as urlsplit
from urlparse import urlunparse as urlunparse
from urlparse import urlunsplit as urlunsplit
from urllib import quote as quote
from urllib import quote_plus as quote_plus
from urllib import unquote as unquote
from urllib import unquote as unquote_to_bytes
from urllib import unquote_plus as unquote_plus
from urllib import urlencode as urlencode
from urllib import splitquery as splitquery
from urllib import splittag as splittag
from urllib import splituser as splituser
from urlparse import uses_fragment as uses_fragment
from urlparse import uses_netloc as uses_netloc
from urlparse import uses_params as uses_params
from urlparse import uses_query as uses_query
from urlparse import uses_relative as uses_relative
from urllib import (
quote as quote,
quote_plus as quote_plus,
splitquery as splitquery,
splittag as splittag,
splituser as splituser,
unquote as unquote_to_bytes,
unquote_plus as unquote_plus,
urlencode as urlencode,
)
from urlparse import (
ParseResult as ParseResult,
SplitResult as SplitResult,
parse_qs as parse_qs,
parse_qsl as parse_qsl,
urldefrag as urldefrag,
urljoin as urljoin,
urlparse as urlparse,
urlsplit as urlsplit,
urlunparse as urlunparse,
urlunsplit as urlunsplit,
uses_fragment as uses_fragment,
uses_netloc as uses_netloc,
uses_params as uses_params,
uses_query as uses_query,
uses_relative as uses_relative,
)

View File

@@ -1,36 +1,40 @@
# Stubs for six.moves.urllib.request
from urllib2 import urlopen as urlopen
from urllib2 import install_opener as install_opener
from urllib2 import build_opener as build_opener
from urllib import pathname2url as pathname2url
from urllib import url2pathname as url2pathname
from urllib import getproxies as getproxies
from urllib2 import Request as Request
from urllib2 import OpenerDirector as OpenerDirector
from urllib2 import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler
from urllib2 import HTTPRedirectHandler as HTTPRedirectHandler
from urllib2 import HTTPCookieProcessor as HTTPCookieProcessor
from urllib2 import ProxyHandler as ProxyHandler
from urllib2 import BaseHandler as BaseHandler
from urllib2 import HTTPPasswordMgr as HTTPPasswordMgr
from urllib2 import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm
from urllib2 import AbstractBasicAuthHandler as AbstractBasicAuthHandler
from urllib2 import HTTPBasicAuthHandler as HTTPBasicAuthHandler
from urllib2 import ProxyBasicAuthHandler as ProxyBasicAuthHandler
from urllib2 import AbstractDigestAuthHandler as AbstractDigestAuthHandler
from urllib2 import HTTPDigestAuthHandler as HTTPDigestAuthHandler
from urllib2 import ProxyDigestAuthHandler as ProxyDigestAuthHandler
from urllib2 import HTTPHandler as HTTPHandler
from urllib2 import HTTPSHandler as HTTPSHandler
from urllib2 import FileHandler as FileHandler
from urllib2 import FTPHandler as FTPHandler
from urllib2 import CacheFTPHandler as CacheFTPHandler
from urllib2 import UnknownHandler as UnknownHandler
from urllib2 import HTTPErrorProcessor as HTTPErrorProcessor
from urllib import urlretrieve as urlretrieve
from urllib import urlcleanup as urlcleanup
from urllib import URLopener as URLopener
from urllib import FancyURLopener as FancyURLopener
from urllib import proxy_bypass as proxy_bypass
from urllib2 import parse_http_list as parse_http_list
from urllib2 import parse_keqv_list as parse_keqv_list
from urllib import (
FancyURLopener as FancyURLopener,
URLopener as URLopener,
getproxies as getproxies,
pathname2url as pathname2url,
proxy_bypass as proxy_bypass,
url2pathname as url2pathname,
urlcleanup as urlcleanup,
urlretrieve as urlretrieve,
)
from urllib2 import (
AbstractBasicAuthHandler as AbstractBasicAuthHandler,
AbstractDigestAuthHandler as AbstractDigestAuthHandler,
BaseHandler as BaseHandler,
CacheFTPHandler as CacheFTPHandler,
FileHandler as FileHandler,
FTPHandler as FTPHandler,
HTTPBasicAuthHandler as HTTPBasicAuthHandler,
HTTPCookieProcessor as HTTPCookieProcessor,
HTTPDefaultErrorHandler as HTTPDefaultErrorHandler,
HTTPDigestAuthHandler as HTTPDigestAuthHandler,
HTTPErrorProcessor as HTTPErrorProcessor,
HTTPHandler as HTTPHandler,
HTTPPasswordMgr as HTTPPasswordMgr,
HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm,
HTTPRedirectHandler as HTTPRedirectHandler,
HTTPSHandler as HTTPSHandler,
OpenerDirector as OpenerDirector,
ProxyBasicAuthHandler as ProxyBasicAuthHandler,
ProxyDigestAuthHandler as ProxyDigestAuthHandler,
ProxyHandler as ProxyHandler,
Request as Request,
UnknownHandler as UnknownHandler,
build_opener as build_opener,
install_opener as install_opener,
parse_http_list as parse_http_list,
parse_keqv_list as parse_keqv_list,
urlopen as urlopen,
)

View File

@@ -1,5 +1,2 @@
# Stubs for six.moves.urllib.response
from urllib import addbase as addbase
from urllib import addclosehook as addclosehook
from urllib import addinfo as addinfo
from urllib import addinfourl as addinfourl
from urllib import addbase as addbase, addclosehook as addclosehook, addinfo as addinfo, addinfourl as addinfourl

View File

@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str

View File

@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str

View File

@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
__revision__: str

View File

@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str

View File

@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str

View File

@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str

View File

@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo

View File

@@ -1,4 +1,4 @@
from typing import Any, Optional, Union, Text
from typing import Any, Optional, Text, Union
from Crypto.PublicKey.RSA import _RSAobj
@@ -9,5 +9,4 @@ class PKCS1OAEP_Cipher:
def encrypt(self, message: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ct: bytes) -> bytes: ...
def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from Crypto.PublicKey.RSA import _RSAobj

View File

@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
__revision__: str
@@ -9,7 +9,6 @@ class XORCipher:
def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ciphertext: bytes) -> bytes: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ...
block_size: int

View File

@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
MODE_ECB: int
MODE_CBC: int

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD2Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD4Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD5Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class RIPEMD160Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA1Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA224Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA256Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA384Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA512Hash(HashAlgo):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash import SHA as SHA1
__revision__: str

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from .pubkey import pubkey
class _DSAobj(pubkey):

View File

@@ -1,7 +1,7 @@
from typing import Any, Optional
from Crypto.PublicKey.pubkey import pubkey
from Crypto.PublicKey.pubkey import * # noqa: F403
from Crypto.PublicKey.pubkey import pubkey
class error(Exception): ...

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional, Union, Text
from typing import Any, Optional, Text, Union
from .pubkey import pubkey
class _RSAobj(pubkey):

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from .rng_base import BaseRNG
class DevURandomRNG(BaseRNG):

View File

@@ -1,6 +1,6 @@
from typing import Any, List, Optional, Sequence, TypeVar
_T = TypeVar('_T')
_T = TypeVar("_T")
class StrongRandom:
def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ...

View File

@@ -1,3 +1,12 @@
from typing import Any
def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ...
def new(
nbits,
prefix: Any = ...,
suffix: Any = ...,
initial_value: int = ...,
overflow: int = ...,
little_endian: bool = ...,
allow_wraparound: bool = ...,
disable_shortcut: bool = ...,
): ...

View File

@@ -6,7 +6,9 @@ class RandomPool:
bytes: Any
bits: Any
entropy: Any
def __init__(self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...) -> None: ...
def __init__(
self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...
) -> None: ...
def get_bytes(self, N): ...
def randomize(self, N: int = ...): ...
def stir(self, s: str = ...): ...

View File

@@ -1,9 +1,11 @@
import sys
from typing import Any, AnyStr, Callable, ContextManager, Generic, IO, Optional, Text, Type, Union
from typing import IO, Any, AnyStr, Callable, ContextManager, Generic, Optional, Text, Type, Union
from _typeshed import AnyPath
def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...
class AtomicWriter(object):
def __init__(self, path: AnyPath, mode: Text = ..., overwrite: bool = ...) -> None: ...
def open(self) -> ContextManager[IO[Any]]: ...
@@ -12,6 +14,5 @@ class AtomicWriter(object):
def sync(self, f: IO[Any]) -> None: ...
def commit(self, f: IO[Any]) -> None: ...
def rollback(self, f: IO[Any]) -> None: ...
def atomic_write(
path: AnyPath, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object,
) -> ContextManager[IO[Any]]: ...
def atomic_write(path: AnyPath, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object,) -> ContextManager[IO[Any]]: ...

View File

@@ -1,25 +1,7 @@
from typing import (
Any,
Callable,
Dict,
Generic,
List,
Optional,
Sequence,
Mapping,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing import Any, Callable, Dict, Generic, List, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload
# `import X as X` is required to make these public
from . import exceptions as exceptions
from . import filters as filters
from . import converters as converters
from . import validators as validators
from . import converters as converters, exceptions as exceptions, filters as filters, validators as validators
from ._version_info import VersionInfo
__version__: str
@@ -55,10 +37,7 @@ NOTHING: object
@overload
def Factory(factory: Callable[[], _T]) -> _T: ...
@overload
def Factory(
factory: Union[Callable[[Any], _T], Callable[[], _T]],
takes_self: bool = ...,
) -> _T: ...
def Factory(factory: Union[Callable[[Any], _T], Callable[[], _T]], takes_self: bool = ...,) -> _T: ...
class Attribute(Generic[_T]):
name: str

View File

@@ -1,11 +1,10 @@
from typing import TypeVar, Optional, Callable, overload
from typing import Callable, Optional, TypeVar, overload
from . import _ConverterType
_T = TypeVar("_T")
def optional(
converter: _ConverterType[_T]
) -> _ConverterType[Optional[_T]]: ...
def optional(converter: _ConverterType[_T]) -> _ConverterType[Optional[_T]]: ...
@overload
def default_if_none(default: _T) -> _ConverterType[_T]: ...
@overload

View File

@@ -1,4 +1,5 @@
from typing import Union, Any
from typing import Any, Union
from . import Attribute, _FilterType
def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ...

View File

@@ -1,19 +1,20 @@
from typing import (
Container,
List,
Union,
TypeVar,
Type,
Any,
AnyStr,
Callable,
Container,
Iterable,
List,
Mapping,
Match,
Optional,
Tuple,
Iterable,
Mapping,
Callable,
Match,
AnyStr,
Type,
TypeVar,
Union,
overload,
)
from . import _ValidatorType
_T = TypeVar("_T")
@@ -32,35 +33,22 @@ def instance_of(type: Type[_T]) -> _ValidatorType[_T]: ...
@overload
def instance_of(type: Tuple[Type[_T]]) -> _ValidatorType[_T]: ...
@overload
def instance_of(
type: Tuple[Type[_T1], Type[_T2]]
) -> _ValidatorType[Union[_T1, _T2]]: ...
def instance_of(type: Tuple[Type[_T1], Type[_T2]]) -> _ValidatorType[Union[_T1, _T2]]: ...
@overload
def instance_of(
type: Tuple[Type[_T1], Type[_T2], Type[_T3]]
) -> _ValidatorType[Union[_T1, _T2, _T3]]: ...
def instance_of(type: Tuple[Type[_T1], Type[_T2], Type[_T3]]) -> _ValidatorType[Union[_T1, _T2, _T3]]: ...
@overload
def instance_of(type: Tuple[type, ...]) -> _ValidatorType[Any]: ...
def provides(interface: Any) -> _ValidatorType[Any]: ...
def optional(
validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]]
) -> _ValidatorType[Optional[_T]]: ...
def optional(validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]]) -> _ValidatorType[Optional[_T]]: ...
def in_(options: Container[_T]) -> _ValidatorType[_T]: ...
def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ...
def matches_re(
regex: AnyStr,
flags: int = ...,
func: Optional[
Callable[[AnyStr, AnyStr, int], Optional[Match[AnyStr]]]
] = ...,
regex: AnyStr, flags: int = ..., func: Optional[Callable[[AnyStr, AnyStr, int], Optional[Match[AnyStr]]]] = ...,
) -> _ValidatorType[AnyStr]: ...
def deep_iterable(
member_validator: _ValidatorType[_T],
iterable_validator: Optional[_ValidatorType[_I]] = ...,
member_validator: _ValidatorType[_T], iterable_validator: Optional[_ValidatorType[_I]] = ...,
) -> _ValidatorType[_I]: ...
def deep_mapping(
key_validator: _ValidatorType[_K],
value_validator: _ValidatorType[_V],
mapping_validator: Optional[_ValidatorType[_M]] = ...,
key_validator: _ValidatorType[_K], value_validator: _ValidatorType[_V], mapping_validator: Optional[_ValidatorType[_M]] = ...,
) -> _ValidatorType[_M]: ...
def is_callable() -> _ValidatorType[_T]: ...

View File

@@ -9,7 +9,6 @@ from bleach.sanitizer import (
Cleaner as Cleaner,
)
__releasedate__: Text
__version__: Text
VERSION: Any # packaging.version.Version
@@ -24,8 +23,5 @@ def clean(
strip_comments: bool = ...,
) -> Text: ...
def linkify(
text: Text,
callbacks: Iterable[_Callback] = ...,
skip_tags: Optional[Container[Text]] = ...,
parse_email: bool = ...,
text: Text, callbacks: Iterable[_Callback] = ..., skip_tags: Optional[Container[Text]] = ..., parse_email: bool = ...,
) -> Text: ...

View File

@@ -1,4 +1,4 @@
from typing import MutableMapping, Any, Text
from typing import Any, MutableMapping, Text
_Attrs = MutableMapping[Any, Text]

View File

@@ -1,5 +1,5 @@
from collections import OrderedDict
from typing import overload, Mapping, Any, Text
from typing import Any, Mapping, Text, overload
def force_unicode(text: Text) -> Text: ...
@overload

View File

@@ -1,5 +1,5 @@
from typing import Any, Optional, Text
import logging
from typing import Any, Optional, Text
from .s3.connection import S3Connection
@@ -23,7 +23,9 @@ perflog: Any
def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ...
def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ...
def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_s3(aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs) -> S3Connection: ...
def connect_s3(
aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs
) -> S3Connection: ...
def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
@@ -41,17 +43,37 @@ def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: O
def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_euca(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ...
def connect_euca(
host: Optional[Any] = ...,
aws_access_key_id: Optional[Any] = ...,
aws_secret_access_key: Optional[Any] = ...,
port: int = ...,
path: str = ...,
is_secure: bool = ...,
**kwargs,
): ...
def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_walrus(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ...
def connect_walrus(
host: Optional[Any] = ...,
aws_access_key_id: Optional[Any] = ...,
aws_secret_access_key: Optional[Any] = ...,
port: int = ...,
path: str = ...,
is_secure: bool = ...,
**kwargs,
): ...
def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_ia(ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs): ...
def connect_ia(
ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs
): ...
def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_cloudsearch2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs): ...
def connect_cloudsearch2(
aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs
): ...
def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
@@ -72,7 +94,15 @@ def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_acc
def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
def storage_uri(uri_str, default_scheme: str = ..., debug: int = ..., validate: bool = ..., bucket_storage_uri_class: Any = ..., suppress_consec_slashes: bool = ..., is_latest: bool = ...): ...
def storage_uri(
uri_str,
default_scheme: str = ...,
debug: int = ...,
validate: bool = ...,
bucket_storage_uri_class: Any = ...,
suppress_consec_slashes: bool = ...,
is_latest: bool = ...,
): ...
def storage_uri_for_key(key): ...
# Explicitly mark this package as incomplete.

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from boto.auth_handler import AuthHandler
SIGV4_DETECT: Any

View File

@@ -1,4 +1,5 @@
from typing import Any
from boto.plugin import Plugin
class NotReadyToAuthenticate(Exception): ...

View File

@@ -1,5 +1,4 @@
import sys
from typing import Any
from six.moves import http_client

View File

@@ -1,4 +1,5 @@
from typing import Any, Dict, Optional, Text
from six.moves import http_client
HAVE_HTTPS_CONNECTION: bool
@@ -63,7 +64,26 @@ class AWSAuthConnection:
provider: Any
auth_service_name: Any
request_hook: Any
def __init__(self, host, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., provider: str = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ...) -> None: ...
def __init__(
self,
host,
aws_access_key_id: Optional[Any] = ...,
aws_secret_access_key: Optional[Any] = ...,
is_secure: bool = ...,
port: Optional[Any] = ...,
proxy: Optional[Any] = ...,
proxy_port: Optional[Any] = ...,
proxy_user: Optional[Any] = ...,
proxy_pass: Optional[Any] = ...,
debug: int = ...,
https_connection_factory: Optional[Any] = ...,
path: str = ...,
provider: str = ...,
security_token: Optional[Any] = ...,
suppress_consec_slashes: bool = ...,
validate_certs: bool = ...,
profile_name: Optional[Any] = ...,
) -> None: ...
auth_region_name: Any
@property
def connection(self): ...
@@ -98,14 +118,53 @@ class AWSAuthConnection:
def get_proxy_url_with_auth(self): ...
def set_host_header(self, request): ...
def set_request_hook(self, hook): ...
def build_base_http_request(self, method, path, auth_path, params: Optional[Any] = ..., headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ...): ...
def make_request(self, method, path, headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ..., auth_path: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., params: Optional[Any] = ..., retry_handler: Optional[Any] = ...): ...
def build_base_http_request(
self,
method,
path,
auth_path,
params: Optional[Any] = ...,
headers: Optional[Any] = ...,
data: str = ...,
host: Optional[Any] = ...,
): ...
def make_request(
self,
method,
path,
headers: Optional[Any] = ...,
data: str = ...,
host: Optional[Any] = ...,
auth_path: Optional[Any] = ...,
sender: Optional[Any] = ...,
override_num_retries: Optional[Any] = ...,
params: Optional[Any] = ...,
retry_handler: Optional[Any] = ...,
): ...
def close(self): ...
class AWSQueryConnection(AWSAuthConnection):
APIVersion: str
ResponseError: Any
def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., security_token: Optional[Any] = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ..., provider: str = ...) -> None: ...
def __init__(
self,
aws_access_key_id: Optional[Any] = ...,
aws_secret_access_key: Optional[Any] = ...,
is_secure: bool = ...,
port: Optional[Any] = ...,
proxy: Optional[Any] = ...,
proxy_port: Optional[Any] = ...,
proxy_user: Optional[Any] = ...,
proxy_pass: Optional[Any] = ...,
host: Optional[Any] = ...,
debug: int = ...,
https_connection_factory: Optional[Any] = ...,
path: str = ...,
security_token: Optional[Any] = ...,
validate_certs: bool = ...,
profile_name: Optional[Any] = ...,
provider: str = ...,
) -> None: ...
def get_utf8_value(self, value): ...
def make_request(self, action, params: Optional[Any] = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237
def build_list_params(self, params, items, label): ...

View File

@@ -1,4 +1,5 @@
from typing import Any
from boto.connection import AWSQueryConnection
RegionData: Any
@@ -11,10 +12,29 @@ class ELBConnection(AWSQueryConnection):
DefaultRegionName: Any
DefaultRegionEndpoint: Any
region: Any
def __init__(self, aws_access_key_id=..., aws_secret_access_key=..., is_secure=..., port=..., proxy=..., proxy_port=..., proxy_user=..., proxy_pass=..., debug=..., https_connection_factory=..., region=..., path=..., security_token=..., validate_certs=..., profile_name=...) -> None: ...
def __init__(
self,
aws_access_key_id=...,
aws_secret_access_key=...,
is_secure=...,
port=...,
proxy=...,
proxy_port=...,
proxy_user=...,
proxy_pass=...,
debug=...,
https_connection_factory=...,
region=...,
path=...,
security_token=...,
validate_certs=...,
profile_name=...,
) -> None: ...
def build_list_params(self, params, items, label): ...
def get_all_load_balancers(self, load_balancer_names=..., marker=...): ...
def create_load_balancer(self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=...): ...
def create_load_balancer(
self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=...
): ...
def create_load_balancer_listeners(self, name, listeners=..., complex_listeners=...): ...
def delete_load_balancer(self, name): ...
def delete_load_balancer_listeners(self, name, ports): ...

View File

@@ -1,4 +1,5 @@
from typing import Any, Optional
from boto.compat import StandardError
class BotoClientError(StandardError):

View File

@@ -1,4 +1,5 @@
from typing import List
import boto.regioninfo
def regions() -> List[boto.regioninfo.RegionInfo]: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, Dict, List, Mapping, Optional, Type
from boto.connection import AWSQueryConnection
class KMSConnection(AWSQueryConnection):
@@ -11,27 +12,71 @@ class KMSConnection(AWSQueryConnection):
region: Any
def __init__(self, **kwargs) -> None: ...
def create_alias(self, alias_name: str, target_key_id: str) -> Optional[Dict[str, Any]]: ...
def create_grant(self, key_id: str, grantee_principal: str, retiring_principal: Optional[str] = ..., operations: Optional[List[str]] = ..., constraints: Optional[Dict[str, Dict[str, str]]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...
def create_key(self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
def decrypt(self, ciphertext_blob: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...
def create_grant(
self,
key_id: str,
grantee_principal: str,
retiring_principal: Optional[str] = ...,
operations: Optional[List[str]] = ...,
constraints: Optional[Dict[str, Dict[str, str]]] = ...,
grant_tokens: Optional[List[str]] = ...,
) -> Optional[Dict[str, Any]]: ...
def create_key(
self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...
) -> Optional[Dict[str, Any]]: ...
def decrypt(
self,
ciphertext_blob: bytes,
encryption_context: Optional[Mapping[str, Any]] = ...,
grant_tokens: Optional[List[str]] = ...,
) -> Optional[Dict[str, Any]]: ...
def delete_alias(self, alias_name: str) -> Optional[Dict[str, Any]]: ...
def describe_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...
def disable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...
def disable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ...
def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...
def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ...
def encrypt(self, key_id: str, plaintext: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...
def generate_data_key(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., number_of_bytes: Optional[int] = ..., key_spec: Optional[str] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...
def generate_data_key_without_plaintext(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., key_spec: Optional[str] = ..., number_of_bytes: Optional[int] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...
def encrypt(
self,
key_id: str,
plaintext: bytes,
encryption_context: Optional[Mapping[str, Any]] = ...,
grant_tokens: Optional[List[str]] = ...,
) -> Optional[Dict[str, Any]]: ...
def generate_data_key(
self,
key_id: str,
encryption_context: Optional[Mapping[str, Any]] = ...,
number_of_bytes: Optional[int] = ...,
key_spec: Optional[str] = ...,
grant_tokens: Optional[List[str]] = ...,
) -> Optional[Dict[str, Any]]: ...
def generate_data_key_without_plaintext(
self,
key_id: str,
encryption_context: Optional[Mapping[str, Any]] = ...,
key_spec: Optional[str] = ...,
number_of_bytes: Optional[int] = ...,
grant_tokens: Optional[List[str]] = ...,
) -> Optional[Dict[str, Any]]: ...
def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ...
def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ...
def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ...
def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
def list_key_policies(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
def list_key_policies(
self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...
) -> Optional[Dict[str, Any]]: ...
def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ...
def re_encrypt(self, ciphertext_blob: bytes, destination_key_id: str, source_encryption_context: Optional[Mapping[str, Any]] = ..., destination_encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...
def re_encrypt(
self,
ciphertext_blob: bytes,
destination_key_id: str,
source_encryption_context: Optional[Mapping[str, Any]] = ...,
destination_encryption_context: Optional[Mapping[str, Any]] = ...,
grant_tokens: Optional[List[str]] = ...,
) -> Optional[Dict[str, Any]]: ...
def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ...
def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ...
def update_key_description(self, key_id: str, description: str) -> Optional[Dict[str, Any]]: ...

View File

@@ -10,7 +10,13 @@ class RegionInfo:
name: Any
endpoint: Any
connection_cls: Any
def __init__(self, connection: Optional[Any] = ..., name: Optional[Any] = ..., endpoint: Optional[Any] = ..., connection_cls: Optional[Any] = ...) -> None: ...
def __init__(
self,
connection: Optional[Any] = ...,
name: Optional[Any] = ...,
endpoint: Optional[Any] = ...,
connection_cls: Optional[Any] = ...,
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def connect(self, **kw_params): ...

View File

@@ -1,14 +1,18 @@
from typing import Optional
from .connection import S3Connection
from typing import List, Optional, Text, Type
from boto.connection import AWSAuthConnection
from boto.regioninfo import RegionInfo
from typing import List, Type, Text
from .connection import S3Connection
class S3RegionInfo(RegionInfo):
def connect(self, name: Optional[Text] = ..., endpoint: Optional[str] = ..., connection_cls: Optional[Type[AWSAuthConnection]] = ..., **kw_params) -> S3Connection: ...
def connect(
self,
name: Optional[Text] = ...,
endpoint: Optional[str] = ...,
connection_cls: Optional[Type[AWSAuthConnection]] = ...,
**kw_params,
) -> S3Connection: ...
def regions() -> List[S3RegionInfo]: ...
def connect_to_region(region_name: Text, **kw_params): ...

View File

@@ -1,6 +1,7 @@
from typing import Any, Dict, List, Optional, Text, Union
from .connection import S3Connection
from .user import User
from typing import Any, Dict, Optional, List, Text, Union
CannedACLStrings: List[str]
@@ -33,7 +34,15 @@ class Grant:
uri: Text
email_address: Text
type: Text
def __init__(self, permission: Optional[Text] = ..., type: Optional[Text] = ..., id: Optional[Text] = ..., display_name: Optional[Text] = ..., uri: Optional[Text] = ..., email_address: Optional[Text] = ...) -> None: ...
def __init__(
self,
permission: Optional[Text] = ...,
type: Optional[Text] = ...,
id: Optional[Text] = ...,
display_name: Optional[Text] = ...,
uri: Optional[Text] = ...,
email_address: Optional[Text] = ...,
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ...
def to_xml(self) -> str: ...

View File

@@ -1,9 +1,9 @@
from typing import Any, Dict, List, Optional, Text, Type
from .bucketlistresultset import BucketListResultSet
from .connection import S3Connection
from .key import Key
from typing import Any, Dict, Optional, Text, Type, List
class S3WebsiteEndpointTranslate:
trans_region: Dict[str, str]
@classmethod
@@ -20,7 +20,9 @@ class Bucket:
name: Text
connection: S3Connection
key_class: Type[Key]
def __init__(self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ...) -> None: ...
def __init__(
self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ...
) -> None: ...
def __iter__(self): ...
def __contains__(self, key_name) -> bool: ...
def startElement(self, name, attrs, connection): ...
@@ -28,45 +30,128 @@ class Bucket:
def endElement(self, name, value, connection): ...
def set_key_class(self, key_class): ...
def lookup(self, key_name, headers: Optional[Dict[Text, Text]] = ...): ...
def get_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., response_headers: Optional[Dict[Text, Text]] = ..., validate: bool = ...) -> Key: ...
def list(self, prefix: Text = ..., delimiter: Text = ..., marker: Text = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...) -> BucketListResultSet: ...
def list_versions(self, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Text] = ...) -> BucketListResultSet: ...
def list_multipart_uploads(self, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...): ...
def get_key(
self,
key_name,
headers: Optional[Dict[Text, Text]] = ...,
version_id: Optional[Any] = ...,
response_headers: Optional[Dict[Text, Text]] = ...,
validate: bool = ...,
) -> Key: ...
def list(
self,
prefix: Text = ...,
delimiter: Text = ...,
marker: Text = ...,
headers: Optional[Dict[Text, Text]] = ...,
encoding_type: Optional[Any] = ...,
) -> BucketListResultSet: ...
def list_versions(
self,
prefix: str = ...,
delimiter: str = ...,
key_marker: str = ...,
version_id_marker: str = ...,
headers: Optional[Dict[Text, Text]] = ...,
encoding_type: Optional[Text] = ...,
) -> BucketListResultSet: ...
def list_multipart_uploads(
self,
key_marker: str = ...,
upload_id_marker: str = ...,
headers: Optional[Dict[Text, Text]] = ...,
encoding_type: Optional[Any] = ...,
): ...
def validate_kwarg_names(self, kwargs, names): ...
def get_all_keys(self, headers: Optional[Dict[Text, Text]] = ..., **params): ...
def get_all_versions(self, headers: Optional[Dict[Text, Text]] = ..., **params): ...
def validate_get_all_versions_params(self, params): ...
def get_all_multipart_uploads(self, headers: Optional[Dict[Text, Text]] = ..., **params): ...
def new_key(self, key_name: Optional[Any] = ...): ...
def generate_url(self, expires_in, method: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ...): ...
def generate_url(
self,
expires_in,
method: str = ...,
headers: Optional[Dict[Text, Text]] = ...,
force_http: bool = ...,
response_headers: Optional[Dict[Text, Text]] = ...,
expires_in_absolute: bool = ...,
): ...
def delete_keys(self, keys, quiet: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def delete_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ...): ...
def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata: Optional[Any] = ..., src_version_id: Optional[Any] = ..., storage_class: str = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., headers: Optional[Dict[Text, Text]] = ..., query_args: Optional[Any] = ...): ...
def set_canned_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ...
def delete_key(
self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ...
): ...
def copy_key(
self,
new_key_name,
src_bucket_name,
src_key_name,
metadata: Optional[Any] = ...,
src_version_id: Optional[Any] = ...,
storage_class: str = ...,
preserve_acl: bool = ...,
encrypt_key: bool = ...,
headers: Optional[Dict[Text, Text]] = ...,
query_args: Optional[Any] = ...,
): ...
def set_canned_acl(
self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...
): ...
def get_xml_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ...
def set_xml_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., query_args: str = ...): ...
def set_acl(self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ...
def set_xml_acl(
self,
acl_str,
key_name: str = ...,
headers: Optional[Dict[Text, Text]] = ...,
version_id: Optional[Any] = ...,
query_args: str = ...,
): ...
def set_acl(
self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...
): ...
def get_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ...
def set_subresource(self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ...
def get_subresource(self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ...
def set_subresource(
self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...
): ...
def get_subresource(
self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...
): ...
def make_public(self, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def add_email_grant(self, permission, email_address, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def add_user_grant(self, permission, user_id, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ...): ...
def add_user_grant(
self,
permission,
user_id,
recursive: bool = ...,
headers: Optional[Dict[Text, Text]] = ...,
display_name: Optional[Any] = ...,
): ...
def list_grants(self, headers: Optional[Dict[Text, Text]] = ...): ...
def get_location(self): ...
def set_xml_logging(self, logging_str, headers: Optional[Dict[Text, Text]] = ...): ...
def enable_logging(self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def enable_logging(
self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...
): ...
def disable_logging(self, headers: Optional[Dict[Text, Text]] = ...): ...
def get_logging_status(self, headers: Optional[Dict[Text, Text]] = ...): ...
def set_as_logging_target(self, headers: Optional[Dict[Text, Text]] = ...): ...
def get_request_payment(self, headers: Optional[Dict[Text, Text]] = ...): ...
def set_request_payment(self, payer: str = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def configure_versioning(self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def configure_versioning(
self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...
): ...
def get_versioning_status(self, headers: Optional[Dict[Text, Text]] = ...): ...
def configure_lifecycle(self, lifecycle_config, headers: Optional[Dict[Text, Text]] = ...): ...
def get_lifecycle_config(self, headers: Optional[Dict[Text, Text]] = ...): ...
def delete_lifecycle_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ...
def configure_website(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def configure_website(
self,
suffix: Optional[Any] = ...,
error_key: Optional[Any] = ...,
redirect_all_requests_to: Optional[Any] = ...,
routing_rules: Optional[Any] = ...,
headers: Optional[Dict[Text, Text]] = ...,
): ...
def set_website_configuration(self, config, headers: Optional[Dict[Text, Text]] = ...): ...
def set_website_configuration_xml(self, xml, headers: Optional[Dict[Text, Text]] = ...): ...
def get_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ...
@@ -83,7 +168,15 @@ class Bucket:
def get_cors_xml(self, headers: Optional[Dict[Text, Text]] = ...): ...
def get_cors(self, headers: Optional[Dict[Text, Text]] = ...): ...
def delete_cors(self, headers: Optional[Dict[Text, Text]] = ...): ...
def initiate_multipart_upload(self, key_name, headers: Optional[Dict[Text, Text]] = ..., reduced_redundancy: bool = ..., metadata: Optional[Any] = ..., encrypt_key: bool = ..., policy: Optional[Any] = ...): ...
def initiate_multipart_upload(
self,
key_name,
headers: Optional[Dict[Text, Text]] = ...,
reduced_redundancy: bool = ...,
metadata: Optional[Any] = ...,
encrypt_key: bool = ...,
policy: Optional[Any] = ...,
): ...
def complete_multipart_upload(self, key_name, upload_id, xml_body, headers: Optional[Dict[Text, Text]] = ...): ...
def cancel_multipart_upload(self, key_name, upload_id, headers: Optional[Dict[Text, Text]] = ...): ...
def delete(self, headers: Optional[Dict[Text, Text]] = ...): ...

View File

@@ -1,9 +1,16 @@
from typing import Any, Iterable, Iterator, Optional
from .bucket import Bucket
from .key import Key
from typing import Any, Iterable, Iterator, Optional
def bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ...
def bucket_lister(
bucket,
prefix: str = ...,
delimiter: str = ...,
marker: str = ...,
headers: Optional[Any] = ...,
encoding_type: Optional[Any] = ...,
): ...
class BucketListResultSet(Iterable[Key]):
bucket: Any
@@ -12,10 +19,26 @@ class BucketListResultSet(Iterable[Key]):
marker: Any
headers: Any
encoding_type: Any
def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ...
def __init__(
self,
bucket: Optional[Any] = ...,
prefix: str = ...,
delimiter: str = ...,
marker: str = ...,
headers: Optional[Any] = ...,
encoding_type: Optional[Any] = ...,
) -> None: ...
def __iter__(self) -> Iterator[Key]: ...
def versioned_bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ...
def versioned_bucket_lister(
bucket,
prefix: str = ...,
delimiter: str = ...,
key_marker: str = ...,
version_id_marker: str = ...,
headers: Optional[Any] = ...,
encoding_type: Optional[Any] = ...,
): ...
class VersionedBucketListResultSet:
bucket: Any
@@ -25,10 +48,21 @@ class VersionedBucketListResultSet:
version_id_marker: Any
headers: Any
encoding_type: Any
def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ...
def __init__(
self,
bucket: Optional[Any] = ...,
prefix: str = ...,
delimiter: str = ...,
key_marker: str = ...,
version_id_marker: str = ...,
headers: Optional[Any] = ...,
encoding_type: Optional[Any] = ...,
) -> None: ...
def __iter__(self) -> Iterator[Key]: ...
def multipart_upload_lister(bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ...
def multipart_upload_lister(
bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...
): ...
class MultiPartUploadListResultSet:
bucket: Any
@@ -36,5 +70,12 @@ class MultiPartUploadListResultSet:
upload_id_marker: Any
headers: Any
encoding_type: Any
def __init__(self, bucket: Optional[Any] = ..., key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ...
def __init__(
self,
bucket: Optional[Any] = ...,
key_marker: str = ...,
upload_id_marker: str = ...,
headers: Optional[Any] = ...,
encoding_type: Optional[Any] = ...,
) -> None: ...
def __iter__(self): ...

View File

@@ -1,9 +1,10 @@
from .bucket import Bucket
from typing import Any, Dict, Optional, Text, Type
from boto.connection import AWSAuthConnection
from boto.exception import BotoClientError
from .bucket import Bucket
def check_lowercase_bucketname(n): ...
def assert_case_insensitive(f): ...
@@ -49,19 +50,79 @@ class S3Connection(AWSAuthConnection):
calling_format: Any
bucket_class: Type[Bucket]
anon: Any
def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Any = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., calling_format: Any = ..., path: str = ..., provider: str = ..., bucket_class: Type[Bucket] = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., anon: bool = ..., validate_certs: Optional[Any] = ..., profile_name: Optional[Any] = ...) -> None: ...
def __init__(
self,
aws_access_key_id: Optional[Any] = ...,
aws_secret_access_key: Optional[Any] = ...,
is_secure: bool = ...,
port: Optional[Any] = ...,
proxy: Optional[Any] = ...,
proxy_port: Optional[Any] = ...,
proxy_user: Optional[Any] = ...,
proxy_pass: Optional[Any] = ...,
host: Any = ...,
debug: int = ...,
https_connection_factory: Optional[Any] = ...,
calling_format: Any = ...,
path: str = ...,
provider: str = ...,
bucket_class: Type[Bucket] = ...,
security_token: Optional[Any] = ...,
suppress_consec_slashes: bool = ...,
anon: bool = ...,
validate_certs: Optional[Any] = ...,
profile_name: Optional[Any] = ...,
) -> None: ...
def __iter__(self): ...
def __contains__(self, bucket_name): ...
def set_bucket_class(self, bucket_class: Type[Bucket]) -> None: ...
def build_post_policy(self, expiration_time, conditions): ...
def build_post_form_args(self, bucket_name, key, expires_in: int = ..., acl: Optional[Any] = ..., success_action_redirect: Optional[Any] = ..., max_content_length: Optional[Any] = ..., http_method: str = ..., fields: Optional[Any] = ..., conditions: Optional[Any] = ..., storage_class: str = ..., server_side_encryption: Optional[Any] = ...): ...
def generate_url_sigv4(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., iso_date: Optional[Any] = ...): ...
def generate_url(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., query_auth: bool = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ..., version_id: Optional[Any] = ...): ...
def build_post_form_args(
self,
bucket_name,
key,
expires_in: int = ...,
acl: Optional[Any] = ...,
success_action_redirect: Optional[Any] = ...,
max_content_length: Optional[Any] = ...,
http_method: str = ...,
fields: Optional[Any] = ...,
conditions: Optional[Any] = ...,
storage_class: str = ...,
server_side_encryption: Optional[Any] = ...,
): ...
def generate_url_sigv4(
self,
expires_in,
method,
bucket: str = ...,
key: str = ...,
headers: Optional[Dict[Text, Text]] = ...,
force_http: bool = ...,
response_headers: Optional[Dict[Text, Text]] = ...,
version_id: Optional[Any] = ...,
iso_date: Optional[Any] = ...,
): ...
def generate_url(
self,
expires_in,
method,
bucket: str = ...,
key: str = ...,
headers: Optional[Dict[Text, Text]] = ...,
query_auth: bool = ...,
force_http: bool = ...,
response_headers: Optional[Dict[Text, Text]] = ...,
expires_in_absolute: bool = ...,
version_id: Optional[Any] = ...,
): ...
def get_all_buckets(self, headers: Optional[Dict[Text, Text]] = ...): ...
def get_canonical_user_id(self, headers: Optional[Dict[Text, Text]] = ...): ...
def get_bucket(self, bucket_name: Text, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...) -> Bucket: ...
def head_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ...): ...
def lookup(self, bucket_name, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ...
def create_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ...): ...
def create_bucket(
self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ...
): ...
def delete_bucket(self, bucket, headers: Optional[Dict[Text, Text]] = ...): ...
def make_request(self, method, bucket: str = ..., key: str = ..., headers: Optional[Any] = ..., data: str = ..., query_args: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., retry_handler: Optional[Any] = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237

View File

@@ -7,7 +7,15 @@ class CORSRule:
allowed_header: Any
max_age_seconds: Any
expose_header: Any
def __init__(self, allowed_method: Optional[Any] = ..., allowed_origin: Optional[Any] = ..., id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...) -> None: ...
def __init__(
self,
allowed_method: Optional[Any] = ...,
allowed_origin: Optional[Any] = ...,
id: Optional[Any] = ...,
allowed_header: Optional[Any] = ...,
max_age_seconds: Optional[Any] = ...,
expose_header: Optional[Any] = ...,
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self) -> str: ...
@@ -16,4 +24,12 @@ class CORSConfiguration(List[CORSRule]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self) -> str: ...
def add_rule(self, allowed_method, allowed_origin, id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...): ...
def add_rule(
self,
allowed_method,
allowed_origin,
id: Optional[Any] = ...,
allowed_header: Optional[Any] = ...,
max_age_seconds: Optional[Any] = ...,
expose_header: Optional[Any] = ...,
): ...

View File

@@ -222,7 +222,8 @@ class Key:
torrent: bool = ...,
version_id: Optional[Any] = ...,
response_headers: Optional[Dict[Text, Text]] = ...,
*, encoding: Text,
*,
encoding: Text,
) -> Text: ...
def add_email_grant(self, permission, email_address, headers: Optional[Dict[Text, Text]] = ...): ...
def add_user_grant(

View File

@@ -6,7 +6,14 @@ class Rule:
status: Any
expiration: Any
transition: Any
def __init__(self, id: Optional[Any] = ..., prefix: Optional[Any] = ..., status: Optional[Any] = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...) -> None: ...
def __init__(
self,
id: Optional[Any] = ...,
prefix: Optional[Any] = ...,
status: Optional[Any] = ...,
expiration: Optional[Any] = ...,
transition: Optional[Any] = ...,
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...
@@ -48,4 +55,11 @@ class Lifecycle(List[Rule]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...
def add_rule(self, id: Optional[Any] = ..., prefix: str = ..., status: str = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...): ...
def add_rule(
self,
id: Optional[Any] = ...,
prefix: str = ...,
status: str = ...,
expiration: Optional[Any] = ...,
transition: Optional[Any] = ...,
): ...

View File

@@ -5,7 +5,13 @@ class Deleted:
version_id: Any
delete_marker: Any
delete_marker_version_id: Any
def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., delete_marker: bool = ..., delete_marker_version_id: Optional[Any] = ...) -> None: ...
def __init__(
self,
key: Optional[Any] = ...,
version_id: Optional[Any] = ...,
delete_marker: bool = ...,
delete_marker_version_id: Optional[Any] = ...,
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
@@ -14,7 +20,9 @@ class Error:
version_id: Any
code: Any
message: Any
def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ...
def __init__(
self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ...
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...

View File

@@ -42,8 +42,29 @@ class MultiPartUpload:
def to_xml(self): ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def get_all_parts(self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ...
def upload_part_from_file(self, fp, part_num, headers: Optional[Any] = ..., replace: bool = ..., cb: Optional[Any] = ..., num_cb: int = ..., md5: Optional[Any] = ..., size: Optional[Any] = ...): ...
def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start: Optional[Any] = ..., end: Optional[Any] = ..., src_version_id: Optional[Any] = ..., headers: Optional[Any] = ...): ...
def get_all_parts(
self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ...
): ...
def upload_part_from_file(
self,
fp,
part_num,
headers: Optional[Any] = ...,
replace: bool = ...,
cb: Optional[Any] = ...,
num_cb: int = ...,
md5: Optional[Any] = ...,
size: Optional[Any] = ...,
): ...
def copy_part_from_key(
self,
src_bucket_name,
src_key_name,
part_num,
start: Optional[Any] = ...,
end: Optional[Any] = ...,
src_version_id: Optional[Any] = ...,
headers: Optional[Any] = ...,
): ...
def complete_upload(self): ...
def cancel_upload(self): ...

View File

@@ -7,7 +7,13 @@ class WebsiteConfiguration:
error_key: Any
redirect_all_requests_to: Any
routing_rules: Any
def __init__(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ...) -> None: ...
def __init__(
self,
suffix: Optional[Any] = ...,
error_key: Optional[Any] = ...,
redirect_all_requests_to: Optional[Any] = ...,
routing_rules: Optional[Any] = ...,
) -> None: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...
@@ -42,7 +48,14 @@ class RoutingRule:
def to_xml(self): ...
@classmethod
def when(cls, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...): ...
def then_redirect(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...): ...
def then_redirect(
self,
hostname: Optional[Any] = ...,
protocol: Optional[Any] = ...,
replace_key: Optional[Any] = ...,
replace_key_prefix: Optional[Any] = ...,
http_redirect_code: Optional[Any] = ...,
): ...
class Condition(_XMLKeyValue):
TRANSLATOR: Any
@@ -58,5 +71,12 @@ class Redirect(_XMLKeyValue):
replace_key: Any
replace_key_prefix: Any
http_redirect_code: Any
def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...) -> None: ...
def __init__(
self,
hostname: Optional[Any] = ...,
protocol: Optional[Any] = ...,
replace_key: Optional[Any] = ...,
replace_key_prefix: Optional[Any] = ...,
http_redirect_code: Optional[Any] = ...,
) -> None: ...
def to_xml(self): ...

View File

@@ -3,14 +3,12 @@ import logging.handlers
import subprocess
import sys
import time
import boto.connection
from typing import (
IO,
Any,
Callable,
ContextManager,
Dict,
IO,
Iterable,
List,
Mapping,
@@ -22,24 +20,30 @@ from typing import (
Union,
)
_KT = TypeVar('_KT')
_VT = TypeVar('_VT')
import boto.connection
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")
if sys.version_info >= (3,):
# TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO
import io
_StringIO = io.StringIO
from hashlib import _Hash
_HashType = _Hash
from email.message import Message as _Message
else:
# TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO
import StringIO
_StringIO = StringIO.StringIO[Any]
from hashlib import _hash
_HashType = _hash
# TODO use email.message.Message once stubs exist
@@ -48,11 +52,9 @@ else:
_Provider = Any # TODO replace this with boto.provider.Provider once stubs exist
_LockType = Any # TODO replace this with _thread.LockType once stubs exist
JSONDecodeError: Type[ValueError]
qsa_of_interest: List[str]
def unquote_v(nv: str) -> Union[str, Tuple[str, str]]: ...
def canonical_string(
method: str,
@@ -62,48 +64,22 @@ def canonical_string(
provider: Optional[_Provider] = ...,
) -> str: ...
def merge_meta(
headers: Mapping[str, str],
metadata: Mapping[str, str],
provider: Optional[_Provider] = ...,
headers: Mapping[str, str], metadata: Mapping[str, str], provider: Optional[_Provider] = ...,
) -> Mapping[str, str]: ...
def get_aws_metadata(
headers: Mapping[str, str],
provider: Optional[_Provider] = ...,
) -> Mapping[str, str]: ...
def retry_url(
url: str,
retry_on_404: bool = ...,
num_retries: int = ...,
timeout: Optional[int] = ...,
) -> str: ...
def get_aws_metadata(headers: Mapping[str, str], provider: Optional[_Provider] = ...,) -> Mapping[str, str]: ...
def retry_url(url: str, retry_on_404: bool = ..., num_retries: int = ..., timeout: Optional[int] = ...,) -> str: ...
class LazyLoadMetadata(Dict[_KT, _VT]):
def __init__(
self,
url: str,
num_retries: int,
timeout: Optional[int] = ...,
) -> None: ...
def __init__(self, url: str, num_retries: int, timeout: Optional[int] = ...,) -> None: ...
def get_instance_metadata(
version: str = ...,
url: str = ...,
data: str = ...,
timeout: Optional[int] = ...,
num_retries: int = ...,
version: str = ..., url: str = ..., data: str = ..., timeout: Optional[int] = ..., num_retries: int = ...,
) -> Optional[LazyLoadMetadata[Any, Any]]: ...
def get_instance_identity(
version: str = ...,
url: str = ...,
timeout: Optional[int] = ...,
num_retries: int = ...,
version: str = ..., url: str = ..., timeout: Optional[int] = ..., num_retries: int = ...,
) -> Optional[Mapping[str, Any]]: ...
def get_instance_userdata(
version: str = ...,
sep: Optional[str] = ...,
url: str = ...,
timeout: Optional[int] = ...,
num_retries: int = ...,
version: str = ..., sep: Optional[str] = ..., url: str = ..., timeout: Optional[int] = ..., num_retries: int = ...,
) -> Mapping[str, str]: ...
ISO8601: str
@@ -117,10 +93,7 @@ def parse_ts(ts: str) -> datetime.datetime: ...
def find_class(module_name: str, class_name: Optional[str] = ...) -> Optional[Type[Any]]: ...
def update_dme(username: str, password: str, dme_id: str, ip_address: str) -> str: ...
def fetch_file(
uri: str,
file: Optional[IO[str]] = ...,
username: Optional[str] = ...,
password: Optional[str] = ...,
uri: str, file: Optional[IO[str]] = ..., username: Optional[str] = ..., password: Optional[str] = ...,
) -> Optional[IO[str]]: ...
class ShellCommand:
@@ -129,38 +102,22 @@ class ShellCommand:
log_fp: _StringIO
wait: bool
fail_fast: bool
def __init__(
self,
command: subprocess._CMD,
wait: bool = ...,
fail_fast: bool = ...,
cwd: Optional[subprocess._TXT] = ...,
self, command: subprocess._CMD, wait: bool = ..., fail_fast: bool = ..., cwd: Optional[subprocess._TXT] = ...,
) -> None: ...
process: subprocess.Popen[Any]
def run(self, cwd: Optional[subprocess._CMD] = ...) -> Optional[int]: ...
def setReadOnly(self, value) -> None: ...
def getStatus(self) -> Optional[int]: ...
status: Optional[int]
def getOutput(self) -> str: ...
output: str
class AuthSMTPHandler(logging.handlers.SMTPHandler):
username: str
password: str
def __init__(
self,
mailhost: str,
username: str,
password: str,
fromaddr: str,
toaddrs: Sequence[str],
subject: str,
self, mailhost: str, username: str, password: str, fromaddr: str, toaddrs: Sequence[str], subject: str,
) -> None: ...
class LRUCache(Dict[_KT, _VT]):
@@ -170,27 +127,19 @@ class LRUCache(Dict[_KT, _VT]):
key = ...
value = ...
def __init__(self, key, value) -> None: ...
_dict: Dict[_KT, LRUCache._Item]
capacity: int
head: Optional[LRUCache._Item]
tail: Optional[LRUCache._Item]
def __init__(self, capacity: int) -> None: ...
# This exists to work around Password.str's name shadowing the str type
_str = str
class Password:
hashfunc: Callable[[bytes], _HashType]
str: Optional[_str]
def __init__(
self,
str: Optional[_str] = ...,
hashfunc: Optional[Callable[[bytes], _HashType]] = ...,
) -> None: ...
def __init__(self, str: Optional[_str] = ..., hashfunc: Optional[Callable[[bytes], _HashType]] = ...,) -> None: ...
def set(self, value: Union[bytes, _str]) -> None: ...
def __eq__(self, other: Any) -> bool: ...
def __len__(self) -> int: ...
@@ -207,32 +156,19 @@ def get_utf8_value(value: str) -> bytes: ...
def mklist(value: Any) -> List[Any]: ...
def pythonize_name(name: str) -> str: ...
def write_mime_multipart(
content: List[Tuple[str, str]],
compress: bool = ...,
deftype: str = ...,
delimiter: str = ...,
content: List[Tuple[str, str]], compress: bool = ..., deftype: str = ..., delimiter: str = ...,
) -> str: ...
def guess_mime_type(content: str, deftype: str) -> str: ...
def compute_md5(
fp: IO[Any],
buf_size: int = ...,
size: Optional[int] = ...,
) -> Tuple[str, str, int]: ...
def compute_md5(fp: IO[Any], buf_size: int = ..., size: Optional[int] = ...,) -> Tuple[str, str, int]: ...
def compute_hash(
fp: IO[Any],
buf_size: int = ...,
size: Optional[int] = ...,
hash_algorithm: Any = ...,
fp: IO[Any], buf_size: int = ..., size: Optional[int] = ..., hash_algorithm: Any = ...,
) -> Tuple[str, str, int]: ...
def find_matching_headers(name: str, headers: Mapping[str, Optional[str]]) -> List[str]: ...
def merge_headers_by_name(name: str, headers: Mapping[str, Optional[str]]) -> str: ...
class RequestHook:
def handle_request_data(
self,
request: boto.connection.HTTPRequest,
response: boto.connection.HTTPResponse,
error: bool = ...,
self, request: boto.connection.HTTPRequest, response: boto.connection.HTTPResponse, error: bool = ...,
) -> Any: ...
def host_is_ipv6(hostname: str) -> bool: ...

View File

@@ -1,15 +1,14 @@
from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type, Dict
from typing import Any, AnyStr, Callable, Dict, Optional, Sequence, Type, TypeVar, Union
def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
def with_init(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
def immutable(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ...
def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ...
NOTHING = Any
_T = TypeVar('_T')
_T = TypeVar("_T")
def attributes(
attrs: Sequence[Union[AnyStr, Attribute]],
@@ -18,7 +17,8 @@ def attributes(
apply_with_repr: bool = ...,
apply_immutable: bool = ...,
store_attributes: Optional[Callable[[type, Attribute], Any]] = ...,
**kw: Optional[Dict[Any, Any]]) -> Callable[[Type[_T]], Type[_T]]: ...
**kw: Optional[Dict[Any, Any]],
) -> Callable[[Type[_T]], Type[_T]]: ...
class Attribute:
def __init__(
@@ -31,4 +31,5 @@ class Attribute:
default_value: Any = ...,
default_factory: Optional[Callable[[None], Any]] = ...,
instance_of: Optional[Any] = ...,
init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...) -> None: ...
init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...,
) -> None: ...

View File

@@ -28,7 +28,6 @@ class SequenceLikelihood(object):
UNLIKELY: int
LIKELY: int
POSITIVE: int
@classmethod
def get_num_categories(cls) -> int: ...

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin5_BulgarianCharToOrderMap: Tuple[int, ...]

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
KOI8R_char_to_order_map: Tuple[int, ...]

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin7_char_to_order_map: Tuple[int, ...]

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
WIN1255_CHAR_TO_ORDER_MAP: Tuple[int, ...]

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin2_HungarianCharToOrderMap: Tuple[int, ...]

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
TIS620CharToOrderMap: Tuple[int, ...]

View File

@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin5_TurkishCharToOrderMap: Tuple[int, ...]

View File

@@ -1,7 +1,8 @@
import sys
from typing import Dict, Pattern, Optional
from typing_extensions import TypedDict
from logging import Logger
from typing import Dict, Optional, Pattern
from typing_extensions import TypedDict
class _FinalResultType(TypedDict):
encoding: str
@@ -24,7 +25,6 @@ class UniversalDetector(object):
done: bool
lang_filter: int
logger: Logger
def __init__(self, lang_filter: int = ...) -> None: ...
def reset(self) -> None: ...
def feed(self, byte_str: bytes) -> None: ...

View File

@@ -15,87 +15,86 @@
"""
from .core import (
Context as Context,
Argument as Argument,
BaseCommand as BaseCommand,
Command as Command,
MultiCommand as MultiCommand,
Group as Group,
CommandCollection as CommandCollection,
Parameter as Parameter,
Context as Context,
Group as Group,
MultiCommand as MultiCommand,
Option as Option,
Argument as Argument,
Parameter as Parameter,
)
from .globals import get_current_context as get_current_context
from .decorators import (
argument as argument,
command as command,
confirmation_option as confirmation_option,
group as group,
help_option as help_option,
make_pass_decorator as make_pass_decorator,
option as option,
pass_context as pass_context,
pass_obj as pass_obj,
make_pass_decorator as make_pass_decorator,
command as command,
group as group,
argument as argument,
option as option,
confirmation_option as confirmation_option,
password_option as password_option,
version_option as version_option,
help_option as help_option,
)
from .exceptions import (
Abort as Abort,
BadArgumentUsage as BadArgumentUsage,
BadOptionUsage as BadOptionUsage,
BadParameter as BadParameter,
ClickException as ClickException,
FileError as FileError,
MissingParameter as MissingParameter,
NoSuchOption as NoSuchOption,
UsageError as UsageError,
)
from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text
from .globals import get_current_context as get_current_context
from .parser import OptionParser as OptionParser
from .termui import (
clear as clear,
confirm as confirm,
echo_via_pager as echo_via_pager,
edit as edit,
get_terminal_size as get_terminal_size,
getchar as getchar,
launch as launch,
pause as pause,
progressbar as progressbar,
prompt as prompt,
secho as secho,
style as style,
unstyle as unstyle,
)
from .types import (
ParamType as ParamType,
BOOL as BOOL,
FLOAT as FLOAT,
INT as INT,
STRING as STRING,
UNPROCESSED as UNPROCESSED,
UUID as UUID,
Choice as Choice,
DateTime as DateTime,
File as File,
FloatRange as FloatRange,
DateTime as DateTime,
Path as Path,
Choice as Choice,
IntRange as IntRange,
ParamType as ParamType,
Path as Path,
Tuple as Tuple,
STRING as STRING,
INT as INT,
FLOAT as FLOAT,
BOOL as BOOL,
UUID as UUID,
UNPROCESSED as UNPROCESSED,
)
from .utils import (
echo as echo,
get_binary_stream as get_binary_stream,
get_text_stream as get_text_stream,
open_file as open_file,
format_filename as format_filename,
get_app_dir as get_app_dir,
get_binary_stream as get_binary_stream,
get_os_args as get_os_args,
get_text_stream as get_text_stream,
open_file as open_file,
)
from .termui import (
prompt as prompt,
confirm as confirm,
get_terminal_size as get_terminal_size,
echo_via_pager as echo_via_pager,
progressbar as progressbar,
clear as clear,
style as style,
unstyle as unstyle,
secho as secho,
edit as edit,
launch as launch,
getchar as getchar,
pause as pause,
)
from .exceptions import (
ClickException as ClickException,
UsageError as UsageError,
BadParameter as BadParameter,
FileError as FileError,
Abort as Abort,
NoSuchOption as NoSuchOption,
BadOptionUsage as BadOptionUsage,
BadArgumentUsage as BadArgumentUsage,
MissingParameter as MissingParameter,
)
from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text
from .parser import OptionParser as OptionParser
# Controls if click should emit the warning about the use of unicode
# literals.
disable_unicode_literals_warning: bool
__version__: str

View File

@@ -1,4 +1,4 @@
from typing import ContextManager, Iterator, Generic, TypeVar, Optional
from typing import ContextManager, Generic, Iterator, Optional, TypeVar
_T = TypeVar("_T")

View File

@@ -22,26 +22,12 @@ from click.parser import OptionParser
_CC = TypeVar("_CC", bound=Callable[[], Any])
def invoke_param_callback(
callback: Callable[[Context, Parameter, Optional[str]], Any],
ctx: Context,
param: Parameter,
value: Optional[str]
) -> Any:
...
def augment_usage_errors(
ctx: Context, param: Optional[Parameter] = ...
) -> ContextManager[None]:
...
callback: Callable[[Context, Parameter, Optional[str]], Any], ctx: Context, param: Parameter, value: Optional[str]
) -> Any: ...
def augment_usage_errors(ctx: Context, param: Optional[Parameter] = ...) -> ContextManager[None]: ...
def iter_params_for_processing(
invocation_order: Sequence[Parameter],
declaration_order: Iterable[Parameter],
) -> Iterable[Parameter]:
...
invocation_order: Sequence[Parameter], declaration_order: Iterable[Parameter],
) -> Iterable[Parameter]: ...
class Context:
parent: Optional[Context]
@@ -66,7 +52,6 @@ class Context:
_meta: Dict[str, Any]
_close_callbacks: List[Any]
_depth: int
def __init__(
self,
command: Command,
@@ -83,56 +68,25 @@ class Context:
ignore_unknown_options: Optional[bool] = ...,
help_option_names: Optional[List[str]] = ...,
token_normalize_func: Optional[Callable[[str], str]] = ...,
color: Optional[bool] = ...
) -> None:
...
color: Optional[bool] = ...,
) -> None: ...
@property
def meta(self) -> Dict[str, Any]:
...
def meta(self) -> Dict[str, Any]: ...
@property
def command_path(self) -> str:
...
def scope(self, cleanup: bool = ...) -> ContextManager[Context]:
...
def make_formatter(self) -> HelpFormatter:
...
def command_path(self) -> str: ...
def scope(self, cleanup: bool = ...) -> ContextManager[Context]: ...
def make_formatter(self) -> HelpFormatter: ...
def call_on_close(self, f: _CC) -> _CC: ...
def close(self) -> None:
...
def find_root(self) -> Context:
...
def find_object(self, object_type: type) -> Any:
...
def ensure_object(self, object_type: type) -> Any:
...
def lookup_default(self, name: str) -> Any:
...
def fail(self, message: str) -> NoReturn:
...
def abort(self) -> NoReturn:
...
def exit(self, code: Union[int, str] = ...) -> NoReturn:
...
def get_usage(self) -> str:
...
def get_help(self) -> str:
...
def close(self) -> None: ...
def find_root(self) -> Context: ...
def find_object(self, object_type: type) -> Any: ...
def ensure_object(self, object_type: type) -> Any: ...
def lookup_default(self, name: str) -> Any: ...
def fail(self, message: str) -> NoReturn: ...
def abort(self) -> NoReturn: ...
def exit(self, code: Union[int, str] = ...) -> NoReturn: ...
def get_usage(self) -> str: ...
def get_help(self) -> str: ...
def invoke(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ...
def forward(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ...
@@ -143,37 +97,20 @@ class BaseCommand:
name: str
context_settings: Dict[Any, Any]
def __init__(self, name: str, context_settings: Optional[Dict[Any, Any]] = ...) -> None: ...
def get_usage(self, ctx: Context) -> str:
...
def get_help(self, ctx: Context) -> str:
...
def make_context(
self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra
) -> Context:
...
def parse_args(self, ctx: Context, args: List[str]) -> List[str]:
...
def invoke(self, ctx: Context) -> Any:
...
def get_usage(self, ctx: Context) -> str: ...
def get_help(self, ctx: Context) -> str: ...
def make_context(self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra) -> Context: ...
def parse_args(self, ctx: Context, args: List[str]) -> List[str]: ...
def invoke(self, ctx: Context) -> Any: ...
def main(
self,
args: Optional[List[str]] = ...,
prog_name: Optional[str] = ...,
complete_var: Optional[str] = ...,
standalone_mode: bool = ...,
**extra
) -> Any:
...
def __call__(self, *args, **kwargs) -> Any:
...
**extra,
) -> Any: ...
def __call__(self, *args, **kwargs) -> Any: ...
class Command(BaseCommand):
callback: Optional[Callable[..., Any]]
@@ -185,7 +122,6 @@ class Command(BaseCommand):
add_help_option: bool
hidden: bool
deprecated: bool
def __init__(
self,
name: str,
@@ -199,50 +135,21 @@ class Command(BaseCommand):
add_help_option: bool = ...,
hidden: bool = ...,
deprecated: bool = ...,
) -> None:
...
def get_params(self, ctx: Context) -> List[Parameter]:
...
def format_usage(
self,
ctx: Context,
formatter: HelpFormatter
) -> None:
...
def collect_usage_pieces(self, ctx: Context) -> List[str]:
...
def get_help_option_names(self, ctx: Context) -> Set[str]:
...
def get_help_option(self, ctx: Context) -> Optional[Option]:
...
def make_parser(self, ctx: Context) -> OptionParser:
...
def get_short_help_str(self, limit: int = ...) -> str:
...
def format_help(self, ctx: Context, formatter: HelpFormatter) -> None:
...
def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None:
...
def format_options(self, ctx: Context, formatter: HelpFormatter) -> None:
...
def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None:
...
_T = TypeVar('_T')
_F = TypeVar('_F', bound=Callable[..., Any])
) -> None: ...
def get_params(self, ctx: Context) -> List[Parameter]: ...
def format_usage(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def collect_usage_pieces(self, ctx: Context) -> List[str]: ...
def get_help_option_names(self, ctx: Context) -> Set[str]: ...
def get_help_option(self, ctx: Context) -> Optional[Option]: ...
def make_parser(self, ctx: Context) -> OptionParser: ...
def get_short_help_str(self, limit: int = ...) -> str: ...
def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: ...
_T = TypeVar("_T")
_F = TypeVar("_F", bound=Callable[..., Any])
class MultiCommand(Command):
no_args_is_help: bool
@@ -250,7 +157,6 @@ class MultiCommand(Command):
subcommand_metavar: str
chain: bool
result_callback: Callable[..., Any]
def __init__(
self,
name: Optional[str] = ...,
@@ -259,95 +165,41 @@ class MultiCommand(Command):
subcommand_metavar: Optional[str] = ...,
chain: bool = ...,
result_callback: Optional[Callable[..., Any]] = ...,
**attrs
) -> None:
...
def resultcallback(
self, replace: bool = ...
) -> Callable[[_F], _F]:
...
def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None:
...
def resolve_command(
self, ctx: Context, args: List[str]
) -> Tuple[str, Command, List[str]]:
...
def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]:
...
def list_commands(self, ctx: Context) -> Iterable[str]:
...
**attrs,
) -> None: ...
def resultcallback(self, replace: bool = ...) -> Callable[[_F], _F]: ...
def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def resolve_command(self, ctx: Context, args: List[str]) -> Tuple[str, Command, List[str]]: ...
def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]: ...
def list_commands(self, ctx: Context) -> Iterable[str]: ...
class Group(MultiCommand):
commands: Dict[str, Command]
def __init__(
self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs
) -> None:
...
def add_command(self, cmd: Command, name: Optional[str] = ...):
...
def __init__(self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs) -> None: ...
def add_command(self, cmd: Command, name: Optional[str] = ...): ...
def command(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Command]: ...
def group(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Group]: ...
class CommandCollection(MultiCommand):
sources: List[MultiCommand]
def __init__(
self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs
) -> None:
...
def add_source(self, multi_cmd: MultiCommand) -> None:
...
def __init__(self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs) -> None: ...
def add_source(self, multi_cmd: MultiCommand) -> None: ...
class _ParamType:
name: str
is_composite: bool
envvar_list_splitter: Optional[str]
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> Any:
...
def get_metavar(self, param: Parameter) -> str:
...
def get_missing_message(self, param: Parameter) -> str:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> Any:
...
def split_envvar_value(self, rv: str) -> List[str]:
...
def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> NoReturn:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> Any: ...
def get_metavar(self, param: Parameter) -> str: ...
def get_missing_message(self, param: Parameter) -> str: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> Any: ...
def split_envvar_value(self, rv: str) -> List[str]: ...
def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> NoReturn: ...
# This type is here to resolve https://github.com/python/mypy/issues/5275
_ConvertibleType = Union[type, _ParamType, Tuple[Union[type, _ParamType], ...],
Callable[[str], Any], Callable[[Optional[str]], Any]]
_ConvertibleType = Union[
type, _ParamType, Tuple[Union[type, _ParamType], ...], Callable[[str], Any], Callable[[Optional[str]], Any]
]
class Parameter:
param_type_name: str
@@ -364,7 +216,6 @@ class Parameter:
is_eager: bool
metavar: Optional[str]
envvar: Union[str, List[str], None]
def __init__(
self,
param_decls: Optional[List[str]] = ...,
@@ -376,58 +227,24 @@ class Parameter:
metavar: Optional[str] = ...,
expose_value: bool = ...,
is_eager: bool = ...,
envvar: Optional[Union[str, List[str]]] = ...
) -> None:
...
envvar: Optional[Union[str, List[str]]] = ...,
) -> None: ...
@property
def human_readable_name(self) -> str:
...
def make_metavar(self) -> str:
...
def get_default(self, ctx: Context) -> Any:
...
def add_to_parser(self, parser: OptionParser, ctx: Context) -> None:
...
def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any:
...
def type_cast_value(self, ctx: Context, value: Any) -> Any:
...
def process_value(self, ctx: Context, value: Any) -> Any:
...
def value_is_missing(self, value: Any) -> bool:
...
def full_process_value(self, ctx: Context, value: Any) -> Any:
...
def resolve_envvar_value(self, ctx: Context) -> str:
...
def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]:
...
def handle_parse_result(
self, ctx: Context, opts: Dict[str, Any], args: List[str]
) -> Tuple[Any, List[str]]:
...
def get_help_record(self, ctx: Context) -> Tuple[str, str]:
...
def get_usage_pieces(self, ctx: Context) -> List[str]:
...
def get_error_hint(self, ctx: Context) -> str:
...
def human_readable_name(self) -> str: ...
def make_metavar(self) -> str: ...
def get_default(self, ctx: Context) -> Any: ...
def add_to_parser(self, parser: OptionParser, ctx: Context) -> None: ...
def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any: ...
def type_cast_value(self, ctx: Context, value: Any) -> Any: ...
def process_value(self, ctx: Context, value: Any) -> Any: ...
def value_is_missing(self, value: Any) -> bool: ...
def full_process_value(self, ctx: Context, value: Any) -> Any: ...
def resolve_envvar_value(self, ctx: Context) -> str: ...
def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]: ...
def handle_parse_result(self, ctx: Context, opts: Dict[str, Any], args: List[str]) -> Tuple[Any, List[str]]: ...
def get_help_record(self, ctx: Context) -> Tuple[str, str]: ...
def get_usage_pieces(self, ctx: Context) -> List[str]: ...
def get_error_hint(self, ctx: Context) -> str: ...
class Option(Parameter):
prompt: str # sic
@@ -444,7 +261,6 @@ class Option(Parameter):
show_default: bool
show_choices: bool
show_envvar: bool
def __init__(
self,
param_decls: Optional[List[str]] = ...,
@@ -462,19 +278,9 @@ class Option(Parameter):
hidden: bool = ...,
show_choices: bool = ...,
show_envvar: bool = ...,
**attrs
) -> None:
...
def prompt_for_value(self, ctx: Context) -> Any:
...
**attrs,
) -> None: ...
def prompt_for_value(self, ctx: Context) -> Any: ...
class Argument(Parameter):
def __init__(
self,
param_decls: Optional[List[str]] = ...,
required: Optional[bool] = ...,
**attrs
) -> None:
...
def __init__(self, param_decls: Optional[List[str]] = ..., required: Optional[bool] = ..., **attrs) -> None: ...

View File

@@ -1,33 +1,19 @@
from distutils.version import Version
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, Text, overload, Protocol
from typing import Any, Callable, Dict, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union, overload
from click.core import Command, Group, Argument, Option, Parameter, Context, _ConvertibleType
from click.core import Argument, Command, Context, Group, Option, Parameter, _ConvertibleType
_T = TypeVar('_T')
_F = TypeVar('_F', bound=Callable[..., Any])
_T = TypeVar("_T")
_F = TypeVar("_F", bound=Callable[..., Any])
class _IdentityFunction(Protocol):
def __call__(self, __x: _T) -> _T: ...
_Callback = Callable[[Context, Union[Option, Parameter], Any], Any]
_Callback = Callable[
[Context, Union[Option, Parameter], Any],
Any
]
def pass_context(__f: _T) -> _T:
...
def pass_obj(__f: _T) -> _T:
...
def make_pass_decorator(
object_type: type, ensure: bool = ...
) -> _IdentityFunction:
...
def pass_context(__f: _T) -> _T: ...
def pass_obj(__f: _T) -> _T: ...
def make_pass_decorator(object_type: type, ensure: bool = ...) -> _IdentityFunction: ...
# NOTE: Decorators below have **attrs converted to concrete constructor
# arguments from core.pyi to help with type checking.
@@ -70,7 +56,6 @@ def group(
# User-defined
**kwargs: Any,
) -> Callable[[Callable[..., Any]], Group]: ...
def argument(
*param_decls: str,
cls: Type[Argument] = ...,
@@ -86,10 +71,7 @@ def argument(
is_eager: bool = ...,
envvar: Optional[Union[str, List[str]]] = ...,
autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]] = ...,
) -> _IdentityFunction:
...
) -> _IdentityFunction: ...
@overload
def option(
*param_decls: str,
@@ -118,10 +100,7 @@ def option(
envvar: Optional[Union[str, List[str]]] = ...,
# User-defined
**kwargs: Any,
) -> _IdentityFunction:
...
) -> _IdentityFunction: ...
@overload
def option(
*param_decls: str,
@@ -150,10 +129,7 @@ def option(
envvar: Optional[Union[str, List[str]]] = ...,
# User-defined
**kwargs: Any,
) -> _IdentityFunction:
...
) -> _IdentityFunction: ...
@overload
def option(
*param_decls: str,
@@ -182,10 +158,7 @@ def option(
envvar: Optional[Union[str, List[str]]] = ...,
# User-defined
**kwargs: Any,
) -> _IdentityFunction:
...
) -> _IdentityFunction: ...
@overload
def option(
*param_decls: str,
@@ -214,10 +187,7 @@ def option(
envvar: Optional[Union[str, List[str]]] = ...,
# User-defined
**kwargs: Any,
) -> _IdentityFunction:
...
) -> _IdentityFunction: ...
def confirmation_option(
*param_decls: str,
cls: Type[Option] = ...,
@@ -241,11 +211,8 @@ def confirmation_option(
metavar: Optional[str] = ...,
expose_value: bool = ...,
is_eager: bool = ...,
envvar: Optional[Union[str, List[str]]] = ...
) -> _IdentityFunction:
...
envvar: Optional[Union[str, List[str]]] = ...,
) -> _IdentityFunction: ...
def password_option(
*param_decls: str,
cls: Type[Option] = ...,
@@ -269,11 +236,8 @@ def password_option(
metavar: Optional[str] = ...,
expose_value: bool = ...,
is_eager: bool = ...,
envvar: Optional[Union[str, List[str]]] = ...
) -> _IdentityFunction:
...
envvar: Optional[Union[str, List[str]]] = ...,
) -> _IdentityFunction: ...
def version_option(
version: Optional[Union[str, Version]] = ...,
*param_decls: str,
@@ -300,11 +264,8 @@ def version_option(
metavar: Optional[str] = ...,
expose_value: bool = ...,
is_eager: bool = ...,
envvar: Optional[Union[str, List[str]]] = ...
) -> _IdentityFunction:
...
envvar: Optional[Union[str, List[str]]] = ...,
) -> _IdentityFunction: ...
def help_option(
*param_decls: str,
cls: Type[Option] = ...,
@@ -328,6 +289,5 @@ def help_option(
metavar: Optional[str] = ...,
expose_value: bool = ...,
is_eager: bool = ...,
envvar: Optional[Union[str, List[str]]] = ...
) -> _IdentityFunction:
...
envvar: Optional[Union[str, List[str]]] = ...,
) -> _IdentityFunction: ...

View File

@@ -1,93 +1,60 @@
from typing import IO, List, Optional, Any
from typing import IO, Any, List, Optional
from click.core import Context, Parameter
class ClickException(Exception):
exit_code: int
message: str
def __init__(self, message: str) -> None:
...
def format_message(self) -> str:
...
def show(self, file: Optional[Any] = ...) -> None:
...
def __init__(self, message: str) -> None: ...
def format_message(self) -> str: ...
def show(self, file: Optional[Any] = ...) -> None: ...
class UsageError(ClickException):
ctx: Optional[Context]
def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: ...
def show(self, file: Optional[IO[Any]] = ...) -> None: ...
class BadParameter(UsageError):
param: Optional[Parameter]
param_hint: Optional[str]
def __init__(
self,
message: str,
ctx: Optional[Context] = ...,
param: Optional[Parameter] = ...,
param_hint: Optional[str] = ...
) -> None:
...
self, message: str, ctx: Optional[Context] = ..., param: Optional[Parameter] = ..., param_hint: Optional[str] = ...
) -> None: ...
class MissingParameter(BadParameter):
param_type: str # valid values: 'parameter', 'option', 'argument'
def __init__(
self,
message: Optional[str] = ...,
ctx: Optional[Context] = ...,
param: Optional[Parameter] = ...,
param_hint: Optional[str] = ...,
param_type: Optional[str] = ...
) -> None:
...
param_type: Optional[str] = ...,
) -> None: ...
class NoSuchOption(UsageError):
option_name: str
possibilities: Optional[List[str]]
def __init__(
self,
option_name: str,
message: Optional[str] = ...,
possibilities: Optional[List[str]] = ...,
ctx: Optional[Context] = ...
) -> None:
...
ctx: Optional[Context] = ...,
) -> None: ...
class BadOptionUsage(UsageError):
def __init__(self, option_name: str, message: str, ctx: Optional[Context] = ...) -> None:
...
def __init__(self, option_name: str, message: str, ctx: Optional[Context] = ...) -> None: ...
class BadArgumentUsage(UsageError):
def __init__(self, message: str, ctx: Optional[Context] = ...) -> None:
...
def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: ...
class FileError(ClickException):
ui_filename: str
filename: str
def __init__(self, filename: str, hint: Optional[str] = ...) -> None: ...
def __init__(self, filename: str, hint: Optional[str] = ...) -> None:
...
class Abort(RuntimeError):
...
class Abort(RuntimeError): ...
class Exit(RuntimeError):
def __init__(self, code: int = ...) -> None:
...
def __init__(self, code: int = ...) -> None: ...

View File

@@ -1,86 +1,29 @@
from typing import ContextManager, Generator, Iterable, List, Optional, Tuple
FORCED_WIDTH: Optional[int]
def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]:
...
def iter_rows(
rows: Iterable[Iterable[str]], col_count: int
) -> Generator[Tuple[str, ...], None, None]:
...
def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]: ...
def iter_rows(rows: Iterable[Iterable[str]], col_count: int) -> Generator[Tuple[str, ...], None, None]: ...
def wrap_text(
text: str,
width: int = ...,
initial_indent: str = ...,
subsequent_indent: str = ...,
preserve_paragraphs: bool = ...
) -> str:
...
text: str, width: int = ..., initial_indent: str = ..., subsequent_indent: str = ..., preserve_paragraphs: bool = ...
) -> str: ...
class HelpFormatter:
indent_increment: int
width: Optional[int]
current_indent: int
buffer: List[str]
def __init__(self, indent_increment: int = ..., width: Optional[int] = ..., max_width: Optional[int] = ...,) -> None: ...
def write(self, string: str) -> None: ...
def indent(self) -> None: ...
def dedent(self) -> None: ...
def write_usage(self, prog: str, args: str = ..., prefix: str = ...,): ...
def write_heading(self, heading: str) -> None: ...
def write_paragraph(self) -> None: ...
def write_text(self, text: str) -> None: ...
def write_dl(self, rows: Iterable[Iterable[str]], col_max: int = ..., col_spacing: int = ...,) -> None: ...
def section(self, name) -> ContextManager[None]: ...
def indentation(self) -> ContextManager[None]: ...
def getvalue(self) -> str: ...
def __init__(
self,
indent_increment: int = ...,
width: Optional[int] = ...,
max_width: Optional[int] = ...,
) -> None:
...
def write(self, string: str) -> None:
...
def indent(self) -> None:
...
def dedent(self) -> None:
...
def write_usage(
self,
prog: str,
args: str = ...,
prefix: str = ...,
):
...
def write_heading(self, heading: str) -> None:
...
def write_paragraph(self) -> None:
...
def write_text(self, text: str) -> None:
...
def write_dl(
self,
rows: Iterable[Iterable[str]],
col_max: int = ...,
col_spacing: int = ...,
) -> None:
...
def section(self, name) -> ContextManager[None]:
...
def indentation(self) -> ContextManager[None]:
...
def getvalue(self) -> str:
...
def join_options(options: List[str]) -> Tuple[str, bool]:
...
def join_options(options: List[str]) -> Tuple[str, bool]: ...

View File

@@ -1,18 +1,8 @@
from click.core import Context
from typing import Optional
from click.core import Context
def get_current_context(silent: bool = ...) -> Context:
...
def push_context(ctx: Context) -> None:
...
def pop_context() -> None:
...
def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]:
...
def get_current_context(silent: bool = ...) -> Context: ...
def push_context(ctx: Context) -> None: ...
def pop_context() -> None: ...
def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]: ...

View File

@@ -2,24 +2,10 @@ from typing import Any, Dict, Iterable, List, Optional, Set, Tuple
from click.core import Context
def _unpack_args(
args: Iterable[str], nargs_spec: Iterable[int]
) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]:
...
def split_opt(opt: str) -> Tuple[str, str]:
...
def normalize_opt(opt: str, ctx: Context) -> str:
...
def split_arg_string(string: str) -> List[str]:
...
def _unpack_args(args: Iterable[str], nargs_spec: Iterable[int]) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]: ...
def split_opt(opt: str) -> Tuple[str, str]: ...
def normalize_opt(opt: str, ctx: Context) -> str: ...
def split_arg_string(string: str) -> List[str]: ...
class Option:
dest: str
@@ -30,7 +16,6 @@ class Option:
prefixes: Set[str]
_short_opts: List[str]
_long_opts: List[str]
def __init__(
self,
opts: Iterable[str],
@@ -38,39 +23,25 @@ class Option:
action: Optional[str] = ...,
nargs: int = ...,
const: Optional[Any] = ...,
obj: Optional[Any] = ...
) -> None:
...
obj: Optional[Any] = ...,
) -> None: ...
@property
def takes_value(self) -> bool:
...
def process(self, value: Any, state: ParsingState) -> None:
...
def takes_value(self) -> bool: ...
def process(self, value: Any, state: ParsingState) -> None: ...
class Argument:
dest: str
nargs: int
obj: Any
def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None:
...
def process(self, value: Any, state: ParsingState) -> None:
...
def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: ...
def process(self, value: Any, state: ParsingState) -> None: ...
class ParsingState:
opts: Dict[str, Any]
largs: List[str]
rargs: List[str]
order: List[Any]
def __init__(self, rargs: List[str]) -> None:
...
def __init__(self, rargs: List[str]) -> None: ...
class OptionParser:
ctx: Optional[Context]
@@ -80,10 +51,7 @@ class OptionParser:
_long_opt: Dict[str, Option]
_opt_prefixes: Set[str]
_args: List[Argument]
def __init__(self, ctx: Optional[Context] = ...) -> None:
...
def __init__(self, ctx: Optional[Context] = ...) -> None: ...
def add_option(
self,
opts: Iterable[str],
@@ -91,14 +59,7 @@ class OptionParser:
action: Optional[str] = ...,
nargs: int = ...,
const: Optional[Any] = ...,
obj: Optional[Any] = ...
) -> None:
...
def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None:
...
def parse_args(
self, args: List[str]
) -> Tuple[Dict[str, Any], List[str], List[Any]]:
...
obj: Optional[Any] = ...,
) -> None: ...
def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: ...
def parse_args(self, args: List[str]) -> Tuple[Dict[str, Any], List[str], List[Any]]: ...

View File

@@ -1,35 +1,10 @@
from typing import (
Any,
Callable,
Generator,
Iterable,
IO,
List,
Optional,
overload,
Text,
Tuple,
TypeVar,
Union,
)
from typing import IO, Any, Callable, Generator, Iterable, List, Optional, Text, Tuple, TypeVar, Union, overload
from click.core import _ConvertibleType
from click._termui_impl import ProgressBar as _ProgressBar
from click.core import _ConvertibleType
def hidden_prompt_func(prompt: str) -> str:
...
def _build_prompt(
text: str,
suffix: str,
show_default: bool = ...,
default: Optional[str] = ...,
) -> str:
...
def hidden_prompt_func(prompt: str) -> str: ...
def _build_prompt(text: str, suffix: str, show_default: bool = ..., default: Optional[str] = ...,) -> str: ...
def prompt(
text: str,
default: Optional[str] = ...,
@@ -41,34 +16,16 @@ def prompt(
show_default: bool = ...,
err: bool = ...,
show_choices: bool = ...,
) -> Any:
...
) -> Any: ...
def confirm(
text: str,
default: bool = ...,
abort: bool = ...,
prompt_suffix: str = ...,
show_default: bool = ...,
err: bool = ...,
) -> bool:
...
def get_terminal_size() -> Tuple[int, int]:
...
text: str, default: bool = ..., abort: bool = ..., prompt_suffix: str = ..., show_default: bool = ..., err: bool = ...,
) -> bool: ...
def get_terminal_size() -> Tuple[int, int]: ...
def echo_via_pager(
text_or_generator: Union[str, Iterable[str], Callable[[], Generator[str, None, None]]],
color: Optional[bool] = ...,
) -> None:
...
_T = TypeVar('_T')
text_or_generator: Union[str, Iterable[str], Callable[[], Generator[str, None, None]]], color: Optional[bool] = ...,
) -> None: ...
_T = TypeVar("_T")
@overload
def progressbar(
iterable: Iterable[_T],
@@ -85,9 +42,7 @@ def progressbar(
width: int = ...,
file: Optional[IO[Any]] = ...,
color: Optional[bool] = ...,
) -> _ProgressBar[_T]:
...
) -> _ProgressBar[_T]: ...
@overload
def progressbar(
iterable: None = ...,
@@ -104,13 +59,8 @@ def progressbar(
width: int = ...,
file: Optional[IO[Any]] = ...,
color: Optional[bool] = ...,
) -> _ProgressBar[int]:
...
def clear() -> None:
...
) -> _ProgressBar[int]: ...
def clear() -> None: ...
def style(
text: Text,
fg: Optional[str] = ...,
@@ -121,13 +71,8 @@ def style(
blink: Optional[bool] = ...,
reverse: Optional[bool] = ...,
reset: bool = ...,
) -> str:
...
def unstyle(text: Text) -> str:
...
) -> str: ...
def unstyle(text: Text) -> str: ...
# Styling options copied from style() for nicer type checking.
def secho(
@@ -144,10 +89,7 @@ def secho(
blink: Optional[bool] = ...,
reverse: Optional[bool] = ...,
reset: bool = ...,
):
...
): ...
def edit(
text: Optional[str] = ...,
editor: Optional[str] = ...,
@@ -155,19 +97,7 @@ def edit(
require_save: bool = ...,
extension: str = ...,
filename: Optional[str] = ...,
) -> str:
...
def launch(url: str, wait: bool = ..., locate: bool = ...) -> int:
...
def getchar(echo: bool = ...) -> Text:
...
def pause(
info: str = ..., err: bool = ...
) -> None:
...
) -> str: ...
def launch(url: str, wait: bool = ..., locate: bool = ...) -> int: ...
def getchar(echo: bool = ...) -> Text: ...
def pause(info: str = ..., err: bool = ...) -> None: ...

View File

@@ -1,5 +1,4 @@
from typing import (IO, Any, BinaryIO, ContextManager, Dict, Iterable, List,
Mapping, Optional, Text, Tuple, Union)
from typing import IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, Mapping, Optional, Text, Tuple, Union
from .core import BaseCommand
@@ -43,22 +42,17 @@ class CliRunner:
env: Mapping[str, str]
echo_stdin: bool
mix_stderr: bool
def __init__(
self,
charset: Optional[Text] = ...,
env: Optional[Mapping[str, str]] = ...,
echo_stdin: bool = ...,
mix_stderr: bool = ...,
) -> None:
...
) -> None: ...
def get_default_prog_name(self, cli: BaseCommand) -> str: ...
def make_env(self, overrides: Optional[Mapping[str, str]] = ...) -> Dict[str, str]: ...
def isolation(
self,
input: Optional[Union[bytes, Text, IO[Any]]] = ...,
env: Optional[Mapping[str, str]] = ...,
color: bool = ...,
self, input: Optional[Union[bytes, Text, IO[Any]]] = ..., env: Optional[Mapping[str, str]] = ..., color: bool = ...,
) -> ContextManager[BinaryIO]: ...
def invoke(
self,
@@ -69,6 +63,5 @@ class CliRunner:
catch_exceptions: bool = ...,
color: bool = ...,
**extra: Any,
) -> Result:
...
) -> Result: ...
def isolated_filesystem(self) -> ContextManager[str]: ...

View File

@@ -1,83 +1,30 @@
from typing import Any, Callable, Generic, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple, Type
import datetime
import uuid
from typing import IO, Any, Callable, Generic, Iterable, List, Optional, Tuple as _PyTuple, Type, TypeVar, Union
from click.core import Context, Parameter, _ParamType as ParamType, _ConvertibleType
from click.core import Context, Parameter, _ConvertibleType, _ParamType as ParamType
class BoolParamType(ParamType):
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> bool:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> bool:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> bool: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> bool: ...
class CompositeParamType(ParamType):
arity: int
class Choice(ParamType):
choices: Iterable[str]
def __init__(
self,
choices: Iterable[str],
case_sensitive: bool = ...,
) -> None:
...
def __init__(self, choices: Iterable[str], case_sensitive: bool = ...,) -> None: ...
class DateTime(ParamType):
def __init__(
self,
formats: Optional[List[str]] = ...,
) -> None:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> datetime.datetime:
...
def __init__(self, formats: Optional[List[str]] = ...,) -> None: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> datetime.datetime: ...
class FloatParamType(ParamType):
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> float:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> float:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> float: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> float: ...
class FloatRange(FloatParamType):
def __init__(
self,
min: Optional[float] = ...,
max: Optional[float] = ...,
clamp: bool = ...,
) -> None:
...
def __init__(self, min: Optional[float] = ..., max: Optional[float] = ..., clamp: bool = ...,) -> None: ...
class File(ParamType):
def __init__(
@@ -92,59 +39,23 @@ class File(ParamType):
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> IO[Any]: ...
def resolve_lazy_flag(self, value: str) -> bool: ...
_F = TypeVar('_F') # result of the function
_F = TypeVar("_F") # result of the function
_Func = Callable[[Optional[str]], _F]
class FuncParamType(ParamType, Generic[_F]):
func: _Func[_F]
def __init__(self, func: _Func[_F]) -> None: ...
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> _F:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> _F:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> _F: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> _F: ...
class IntParamType(ParamType):
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> int:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> int:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> int: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> int: ...
class IntRange(IntParamType):
def __init__(
self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ...
) -> None:
...
_PathType = TypeVar('_PathType', str, bytes)
def __init__(self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ...) -> None: ...
_PathType = TypeVar("_PathType", str, bytes)
class Path(ParamType):
def __init__(
@@ -157,93 +68,28 @@ class Path(ParamType):
resolve_path: bool = ...,
allow_dash: bool = ...,
path_type: Optional[Type[_PathType]] = ...,
) -> None:
...
def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType:
...
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> _PathType:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> _PathType:
...
) -> None: ...
def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType: ...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> _PathType: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> _PathType: ...
class StringParamType(ParamType):
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> str:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> str:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> str: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> str: ...
class Tuple(CompositeParamType):
types: List[ParamType]
def __init__(self, types: Iterable[Any]) -> None: ...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> Tuple: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> Tuple: ...
def __init__(self, types: Iterable[Any]) -> None:
...
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> Tuple:
...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> Tuple:
...
class UnprocessedParamType(ParamType):
...
class UnprocessedParamType(ParamType): ...
class UUIDParameterType(ParamType):
def __call__(
self,
value: Optional[str],
param: Optional[Parameter] = ...,
ctx: Optional[Context] = ...,
) -> uuid.UUID:
...
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...,) -> uuid.UUID: ...
def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context],) -> uuid.UUID: ...
def convert(
self,
value: str,
param: Optional[Parameter],
ctx: Optional[Context],
) -> uuid.UUID:
...
def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType:
...
def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType: ...
# parameter type shortcuts

View File

@@ -1,23 +1,11 @@
from typing import Any, AnyStr, Callable, Generic, Iterator, IO, List, Optional, TypeVar, Union, Text
from typing import IO, Any, AnyStr, Callable, Generic, Iterator, List, Optional, Text, TypeVar, Union
_T = TypeVar('_T')
def _posixify(name: str) -> str:
...
def safecall(func: _T) -> _T:
...
def make_str(value: Any) -> str:
...
def make_default_short_help(help: str, max_length: int = ...):
...
_T = TypeVar("_T")
def _posixify(name: str) -> str: ...
def safecall(func: _T) -> _T: ...
def make_str(value: Any) -> str: ...
def make_default_short_help(help: str, max_length: int = ...): ...
class LazyFile(object):
name: str
@@ -25,14 +13,8 @@ class LazyFile(object):
encoding: Optional[str]
errors: str
atomic: bool
def __init__(
self,
filename: str,
mode: str = ...,
encoding: Optional[str] = ...,
errors: str = ...,
atomic: bool = ...
self, filename: str, mode: str = ..., encoding: Optional[str] = ..., errors: str = ..., atomic: bool = ...
) -> None: ...
def open(self) -> IO[Any]: ...
def close(self) -> None: ...
@@ -49,40 +31,13 @@ class KeepOpenFile(Generic[AnyStr]):
def __iter__(self) -> Iterator[AnyStr]: ...
def echo(
message: object = ...,
file: Optional[IO[Text]] = ...,
nl: bool = ...,
err: bool = ...,
color: Optional[bool] = ...,
) -> None:
...
def get_binary_stream(name: str) -> IO[bytes]:
...
def get_text_stream(
name: str, encoding: Optional[str] = ..., errors: str = ...
) -> IO[str]:
...
message: object = ..., file: Optional[IO[Text]] = ..., nl: bool = ..., err: bool = ..., color: Optional[bool] = ...,
) -> None: ...
def get_binary_stream(name: str) -> IO[bytes]: ...
def get_text_stream(name: str, encoding: Optional[str] = ..., errors: str = ...) -> IO[str]: ...
def open_file(
filename: str,
mode: str = ...,
encoding: Optional[str] = ...,
errors: str = ...,
lazy: bool = ...,
atomic: bool = ...
filename: str, mode: str = ..., encoding: Optional[str] = ..., errors: str = ..., lazy: bool = ..., atomic: bool = ...
) -> Any: ... # really Union[IO, LazyFile, KeepOpenFile]
def get_os_args() -> List[str]:
...
def format_filename(filename: str, shorten: bool = ...) -> str:
...
def get_app_dir(
app_name: str, roaming: bool = ..., force_posix: bool = ...
) -> str:
...
def get_os_args() -> List[str]: ...
def format_filename(filename: str, shorten: bool = ...) -> str: ...
def get_app_dir(app_name: str, roaming: bool = ..., force_posix: bool = ...) -> str: ...

Some files were not shown because too many files have changed in this diff Show More