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
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
__revision__: str
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
+1 -2
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: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
from Crypto.PublicKey.RSA import _RSAobj
+1 -2
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
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import Any, Union, Text
from typing import Any, Text, Union
MODE_ECB: int
MODE_CBC: int
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD2Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD4Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD5Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class RIPEMD160Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA1Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA224Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA256Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA384Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA512Hash(HashAlgo):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from Crypto.Hash import SHA as SHA1
__revision__: str
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from .pubkey import pubkey
class _DSAobj(pubkey):
+1 -1
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): ...
+2 -1
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):
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from .rng_base import BaseRNG
class DevURandomRNG(BaseRNG):
+1 -1
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: ...
+10 -1
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 = ...,
): ...
+3 -1
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 = ...): ...
+5 -4
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]]: ...
+3 -24
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
+3 -4
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
+2 -1
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]: ...
+17 -29
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]: ...
+1 -5
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: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import MutableMapping, Any, Text
from typing import Any, MutableMapping, Text
_Attrs = MutableMapping[Any, Text]
+1 -1
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
+37 -7
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.
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from boto.auth_handler import AuthHandler
SIGV4_DETECT: Any
+1
View File
@@ -1,4 +1,5 @@
from typing import Any
from boto.plugin import Plugin
class NotReadyToAuthenticate(Exception): ...
-1
View File
@@ -1,5 +1,4 @@
import sys
from typing import Any
from six.moves import http_client
+63 -4
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): ...
+22 -2
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): ...
+1
View File
@@ -1,4 +1,5 @@
from typing import Any, Optional
from boto.compat import StandardError
class BotoClientError(StandardError):
+1
View File
@@ -1,4 +1,5 @@
from typing import List
import boto.regioninfo
def regions() -> List[boto.regioninfo.RegionInfo]: ...
+53 -8
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]]: ...
+7 -1
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): ...
+9 -5
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): ...
+11 -2
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: ...
+113 -20
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]] = ...): ...
+49 -8
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): ...
+68 -7
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
+18 -2
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] = ...,
): ...
+2 -1
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(
+16 -2
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] = ...,
): ...
+10 -2
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): ...
+24 -3
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): ...
+23 -3
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): ...
+24 -88
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: ...
+6 -5
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: ...
-1
View File
@@ -28,7 +28,6 @@ class SequenceLikelihood(object):
UNLIKELY: int
LIKELY: int
POSITIVE: int
@classmethod
def get_num_categories(cls) -> int: ...
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin5_BulgarianCharToOrderMap: Tuple[int, ...]
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
KOI8R_char_to_order_map: Tuple[int, ...]
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin7_char_to_order_map: Tuple[int, ...]
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
WIN1255_CHAR_TO_ORDER_MAP: Tuple[int, ...]
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin2_HungarianCharToOrderMap: Tuple[int, ...]
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
TIS620CharToOrderMap: Tuple[int, ...]
+1
View File
@@ -1,4 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin5_TurkishCharToOrderMap: Tuple[int, ...]
+3 -3
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: ...
+54 -55
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
+1 -1
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")
+84 -278
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: ...
+21 -61
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: ...
+15 -48
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: ...
+17 -74
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]: ...
+5 -15
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]: ...
+16 -55
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]]: ...
+21 -91
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: ...
+4 -11
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]: ...
+30 -184
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
+15 -60
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: ...
+4 -2
View File
@@ -2,7 +2,7 @@ import datetime
from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union
_RetType = Union[Type[float], Type[datetime.datetime]]
_SelfT = TypeVar('_SelfT', bound=croniter)
_SelfT = TypeVar("_SelfT", bound=croniter)
class CroniterError(ValueError): ...
class CroniterBadCronError(CroniterError): ...
@@ -22,7 +22,9 @@ class croniter(Iterator[Any]):
start_time: float
dst_start_time: float
nth_weekday_of_month: Dict[str, Any]
def __init__(self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...) -> None: ...
def __init__(
self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...
) -> None: ...
# Most return value depend on ret_type, which can be passed in both as a method argument and as
# a constructor argument.
def get_next(self, ret_type: Optional[_RetType] = ...) -> Any: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import List, Optional, Union, Text
from typing import List, Optional, Text, Union
class InvalidToken(Exception): ...
@@ -1,5 +1,4 @@
from abc import ABCMeta, abstractmethod
from typing import Union
from cryptography.hazmat.backends.interfaces import DSABackend
@@ -61,8 +60,9 @@ class DSAPublicKey(metaclass=ABCMeta):
@abstractmethod
def public_numbers(self) -> DSAPublicNumbers: ...
@abstractmethod
def verifier(self, signature: bytes,
signature_algorithm: Union[HashAlgorithm, Prehashed]) -> AsymmetricVerificationContext: ...
def verifier(
self, signature: bytes, signature_algorithm: Union[HashAlgorithm, Prehashed]
) -> AsymmetricVerificationContext: ...
@abstractmethod
def verify(self, signature: bytes, data: bytes, algorithm: Union[HashAlgorithm, Prehashed]) -> None: ...
@@ -2,8 +2,8 @@ from abc import ABCMeta, abstractmethod
from typing import ClassVar, Union
from cryptography.hazmat.backends.interfaces import EllipticCurveBackend
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
from cryptography.hazmat.primitives.hashes import HashAlgorithm
from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat
from cryptography.x509 import ObjectIdentifier
@@ -157,7 +157,9 @@ class EllipticCurvePublicKey(metaclass=ABCMeta):
@abstractmethod
def public_numbers(self) -> EllipticCurvePublicNumbers: ...
@abstractmethod
def verifier(self, signature: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> AsymmetricVerificationContext: ...
def verifier(
self, signature: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm
) -> AsymmetricVerificationContext: ...
@abstractmethod
def verify(self, signature: bytes, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> None: ...
@@ -38,11 +38,13 @@ class RSAPublicKey(metaclass=ABCMeta):
@abstractmethod
def public_numbers(self) -> RSAPublicNumbers: ...
@abstractmethod
def verifier(self, signature: bytes, padding: AsymmetricPadding,
algorithm: Union[HashAlgorithm, Prehashed]) -> AsymmetricVerificationContext: ...
def verifier(
self, signature: bytes, padding: AsymmetricPadding, algorithm: Union[HashAlgorithm, Prehashed]
) -> AsymmetricVerificationContext: ...
@abstractmethod
def verify(self, signature: bytes, data: bytes, padding: AsymmetricPadding,
algorithm: Union[HashAlgorithm, Prehashed]) -> None: ...
def verify(
self, signature: bytes, data: bytes, padding: AsymmetricPadding, algorithm: Union[HashAlgorithm, Prehashed]
) -> None: ...
RSAPublicKeyWithSerialization = RSAPublicKey
@@ -1,16 +1,12 @@
from typing import Optional, Tuple
from cryptography.hazmat.primitives.hashes import HashAlgorithm
def decode_dss_signature(signature: bytes) -> Tuple[int, int]: ...
def encode_dss_signature(r: int, s: int) -> bytes: ...
class Prehashed(object):
_algorithm: HashAlgorithm # undocumented
_digest_size: int # undocumented
_algorithm: HashAlgorithm # undocumented
_digest_size: int # undocumented
def __init__(self, algorithm: HashAlgorithm) -> None: ...
digest_size: int
@@ -1,8 +1,8 @@
from typing import FrozenSet
from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm
from cryptography.hazmat.primitives.ciphers.modes import ModeWithNonce
from typing import FrozenSet
class AES(BlockCipherAlgorithm, CipherAlgorithm):
def __init__(self, key: bytes) -> None: ...
block_size: int = ...
+11 -7
View File
@@ -2,7 +2,7 @@ import datetime
from abc import ABCMeta, abstractmethod
from enum import Enum
from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network
from typing import Any, ClassVar, Generator, List, Optional, Union, Text, Iterable, Sequence, Type
from typing import Any, ClassVar, Generator, Iterable, List, Optional, Sequence, Text, Type, Union
from cryptography.hazmat.backends.interfaces import X509Backend
from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey
@@ -141,12 +141,16 @@ class Certificate(metaclass=ABCMeta):
def public_key(self) -> Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey]: ...
class CertificateBuilder(object):
def __init__(self, issuer_name: Optional[Name] = ..., subject_name: Optional[Name] = ...,
public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey, None] = ...,
serial_number: Optional[int] = ...,
not_valid_before: Optional[datetime.datetime] = ...,
not_valid_after: Optional[datetime.datetime] = ...,
extensions: Optional[Iterable[ExtensionType]] = ...) -> None: ...
def __init__(
self,
issuer_name: Optional[Name] = ...,
subject_name: Optional[Name] = ...,
public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey, None] = ...,
serial_number: Optional[int] = ...,
not_valid_before: Optional[datetime.datetime] = ...,
not_valid_after: Optional[datetime.datetime] = ...,
extensions: Optional[Iterable[ExtensionType]] = ...,
) -> None: ...
def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateBuilder: ...
def issuer_name(self, name: Name) -> CertificateBuilder: ...
def not_valid_after(self, time: datetime.datetime) -> CertificateBuilder: ...
-1
View File
@@ -11,5 +11,4 @@ def parse(
region: Optional[str] = ...,
settings: Optional[Mapping[str, Any]] = ...,
) -> Optional[datetime.datetime]: ...
def __getattr__(name: str) -> Any: ... # incomplete
+12 -3
View File
@@ -1,5 +1,6 @@
from typing import Any, Optional, Union, Iterable
import datetime
from typing import Any, Iterable, Optional, Union
from dateutil.relativedelta import relativedelta
class DateTimeRange(object):
@@ -8,7 +9,13 @@ class DateTimeRange(object):
end_time_format: str
is_output_elapse: bool
separator: str
def __init__(self, start_datetime: Optional[Union[datetime.datetime, str]] = ..., end_datetime: Optional[Union[datetime.datetime, str]] = ..., start_time_format: str = ..., end_time_format: str = ...) -> None: ...
def __init__(
self,
start_datetime: Optional[Union[datetime.datetime, str]] = ...,
end_datetime: Optional[Union[datetime.datetime, str]] = ...,
start_time_format: str = ...,
end_time_format: str = ...,
) -> None: ...
def __eq__(self, other) -> bool: ...
def __ne__(self, other) -> bool: ...
def __add__(self, other) -> DateTimeRange: ...
@@ -31,7 +38,9 @@ class DateTimeRange(object):
def get_timedelta_second(self) -> float: ...
def set_start_datetime(self, value: Optional[Union[datetime.datetime, str]], timezone: Optional[str] = ...) -> None: ...
def set_end_datetime(self, value: Optional[Union[datetime.datetime, str]], timezone: Optional[str] = ...) -> None: ...
def set_time_range(self, start: Optional[Union[datetime.datetime, str]], end: Optional[Union[datetime.datetime, str]]) -> None: ...
def set_time_range(
self, start: Optional[Union[datetime.datetime, str]], end: Optional[Union[datetime.datetime, str]]
) -> None: ...
def range(self, step: Union[datetime.timedelta, relativedelta]) -> Iterable[datetime.datetime]: ...
def intersection(self, x: DateTimeRange) -> DateTimeRange: ...
def encompass(self, x: DateTimeRange) -> DateTimeRange: ...
-5
View File
@@ -4,14 +4,9 @@ _T = TypeVar("_T")
class weekday(object):
def __init__(self, weekday: int, n: Optional[int] = ...) -> None: ...
def __call__(self: _T, n: int) -> _T: ...
def __eq__(self, other) -> bool: ...
def __repr__(self) -> str: ...
def __hash__(self) -> int: ...
weekday: int
n: int
+1
View File
@@ -1,4 +1,5 @@
from datetime import date
from typing_extensions import Literal
EASTER_JULIAN: Literal[1]
+11 -7
View File
@@ -1,9 +1,8 @@
from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text
from datetime import datetime, tzinfo
from typing import IO, Any, Callable, Dict, List, Mapping, Optional, Text, Tuple, Union
_FileOrStr = Union[bytes, Text, IO[str], IO[Any]]
class parserinfo(object):
JUMP: List[str]
WEEKDAYS: List[Tuple[str, str]]
@@ -13,7 +12,6 @@ class parserinfo(object):
UTCZONE: List[str]
PERTAIN: List[str]
TZOFFSET: Dict[str, int]
def __init__(self, dayfirst: bool = ..., yearfirst: bool = ...) -> None: ...
def jump(self, name: Text) -> bool: ...
def weekday(self, name: Text) -> Optional[int]: ...
@@ -28,15 +26,21 @@ class parserinfo(object):
class parser(object):
def __init__(self, info: Optional[parserinfo] = ...) -> None: ...
def parse(self, timestr: _FileOrStr,
default: Optional[datetime] = ...,
ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ...,
**kwargs: Any) -> datetime: ...
def parse(
self,
timestr: _FileOrStr,
default: Optional[datetime] = ...,
ignoretz: bool = ...,
tzinfos: Optional[Mapping[Text, tzinfo]] = ...,
**kwargs: Any,
) -> datetime: ...
def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ...
DEFAULTPARSER: parser
def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ...
class _tzparser: ...
DEFAULTTZPARSER: _tzparser
+27 -21
View File
@@ -1,11 +1,10 @@
from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union
from datetime import date, datetime, timedelta
from typing import Any, List, Optional, SupportsFloat, TypeVar, Union, overload
from ._common import weekday
_SelfT = TypeVar('_SelfT', bound=relativedelta)
_DateT = TypeVar('_DateT', date, datetime)
_SelfT = TypeVar("_SelfT", bound=relativedelta)
_DateT = TypeVar("_DateT", date, datetime)
# Work around attribute and type having the same name.
_weekday = weekday
@@ -17,7 +16,6 @@ FR: weekday
SA: weekday
SU: weekday
class relativedelta(object):
years: int
months: int
@@ -35,22 +33,30 @@ class relativedelta(object):
minute: Optional[int]
second: Optional[int]
microsecond: Optional[int]
def __init__(self,
dt1: Optional[date] = ...,
dt2: Optional[date] = ...,
years: Optional[int] = ..., months: Optional[int] = ...,
days: Optional[int] = ..., leapdays: Optional[int] = ...,
weeks: Optional[int] = ...,
hours: Optional[int] = ..., minutes: Optional[int] = ...,
seconds: Optional[int] = ..., microseconds: Optional[int] = ...,
year: Optional[int] = ..., month: Optional[int] = ...,
day: Optional[int] = ...,
weekday: Optional[Union[int, _weekday]] = ...,
yearday: Optional[int] = ...,
nlyearday: Optional[int] = ...,
hour: Optional[int] = ..., minute: Optional[int] = ...,
second: Optional[int] = ...,
microsecond: Optional[int] = ...) -> None: ...
def __init__(
self,
dt1: Optional[date] = ...,
dt2: Optional[date] = ...,
years: Optional[int] = ...,
months: Optional[int] = ...,
days: Optional[int] = ...,
leapdays: Optional[int] = ...,
weeks: Optional[int] = ...,
hours: Optional[int] = ...,
minutes: Optional[int] = ...,
seconds: Optional[int] = ...,
microseconds: Optional[int] = ...,
year: Optional[int] = ...,
month: Optional[int] = ...,
day: Optional[int] = ...,
weekday: Optional[Union[int, _weekday]] = ...,
yearday: Optional[int] = ...,
nlyearday: Optional[int] = ...,
hour: Optional[int] = ...,
minute: Optional[int] = ...,
second: Optional[int] = ...,
microsecond: Optional[int] = ...,
) -> None: ...
@property
def weeks(self) -> int: ...
@weeks.setter
+24 -22
View File
@@ -1,6 +1,7 @@
from ._common import weekday as weekdaybase
from typing import Any, Iterable, Optional, Union
import datetime
from typing import Any, Iterable, Optional, Union
from ._common import weekday as weekdaybase
YEARLY: int
MONTHLY: int
@@ -10,8 +11,7 @@ HOURLY: int
MINUTELY: int
SECONDLY: int
class weekday(weekdaybase):
...
class weekday(weekdaybase): ...
MO: weekday
TU: weekday
@@ -33,24 +33,26 @@ class rrulebase:
def between(self, after, before, inc: bool = ..., count: int = ...): ...
class rrule(rrulebase):
def __init__(self,
freq,
dtstart: Optional[datetime.date] = ...,
interval: int = ...,
wkst: Optional[Union[weekday, int]] = ...,
count: Optional[int] = ...,
until: Optional[Union[datetime.date, int]] = ...,
bysetpos: Optional[Union[int, Iterable[int]]] = ...,
bymonth: Optional[Union[int, Iterable[int]]] = ...,
bymonthday: Optional[Union[int, Iterable[int]]] = ...,
byyearday: Optional[Union[int, Iterable[int]]] = ...,
byeaster: Optional[Union[int, Iterable[int]]] = ...,
byweekno: Optional[Union[int, Iterable[int]]] = ...,
byweekday: Optional[Union[int, weekday, Iterable[int], Iterable[weekday]]] = ...,
byhour: Optional[Union[int, Iterable[int]]] = ...,
byminute: Optional[Union[int, Iterable[int]]] = ...,
bysecond: Optional[Union[int, Iterable[int]]] = ...,
cache: bool = ...) -> None: ...
def __init__(
self,
freq,
dtstart: Optional[datetime.date] = ...,
interval: int = ...,
wkst: Optional[Union[weekday, int]] = ...,
count: Optional[int] = ...,
until: Optional[Union[datetime.date, int]] = ...,
bysetpos: Optional[Union[int, Iterable[int]]] = ...,
bymonth: Optional[Union[int, Iterable[int]]] = ...,
bymonthday: Optional[Union[int, Iterable[int]]] = ...,
byyearday: Optional[Union[int, Iterable[int]]] = ...,
byeaster: Optional[Union[int, Iterable[int]]] = ...,
byweekno: Optional[Union[int, Iterable[int]]] = ...,
byweekday: Optional[Union[int, weekday, Iterable[int], Iterable[weekday]]] = ...,
byhour: Optional[Union[int, Iterable[int]]] = ...,
byminute: Optional[Union[int, Iterable[int]]] = ...,
bysecond: Optional[Union[int, Iterable[int]]] = ...,
cache: bool = ...,
) -> None: ...
def replace(self, **kwargs): ...
class _iterinfo:
+8 -8
View File
@@ -1,15 +1,15 @@
from .tz import (
tzutc as tzutc,
tzoffset as tzoffset,
tzlocal as tzlocal,
datetime_ambiguous as datetime_ambiguous,
datetime_exists as datetime_exists,
gettz as gettz,
resolve_imaginary as resolve_imaginary,
tzfile as tzfile,
tzical as tzical,
tzlocal as tzlocal,
tzoffset as tzoffset,
tzrange as tzrange,
tzstr as tzstr,
tzical as tzical,
gettz as gettz,
datetime_exists as datetime_exists,
datetime_ambiguous as datetime_ambiguous,
resolve_imaginary as resolve_imaginary,
tzutc as tzutc,
)
UTC: tzutc
+1 -1
View File
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta, tzinfo
from typing import Any, Optional
from datetime import datetime, tzinfo, timedelta
def tzname_in_python2(namefunc): ...
def enfold(dt: datetime, fold: int = ...): ...
+12 -7
View File
@@ -1,8 +1,8 @@
from typing import Any, Optional, Union, IO, Text, Tuple, List
import datetime
from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo
from ._common import tzrangebase as tzrangebase, enfold as enfold
from typing import IO, Any, List, Optional, Text, Tuple, Union
from ..relativedelta import relativedelta
from ._common import _tzinfo as _tzinfo, enfold as enfold, tzname_in_python2 as tzname_in_python2, tzrangebase as tzrangebase
_FileObj = Union[str, Text, IO[str], IO[Text]]
@@ -30,7 +30,6 @@ class tzoffset(datetime.tzinfo):
__hash__: Any
def __ne__(self, other): ...
__reduce__: Any
@classmethod
def instance(cls, name, offset) -> tzoffset: ...
@@ -65,14 +64,21 @@ class tzfile(_tzinfo):
class tzrange(tzrangebase):
hasdst: bool
def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ...
def __init__(
self,
stdabbr: Text,
stdoffset: Union[int, datetime.timedelta, None] = ...,
dstabbr: Optional[Text] = ...,
dstoffset: Union[int, datetime.timedelta, None] = ...,
start: Optional[relativedelta] = ...,
end: Optional[relativedelta] = ...,
) -> None: ...
def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ...
def __eq__(self, other): ...
class tzstr(tzrange):
hasdst: bool
def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ...
@classmethod
def instance(cls, name, offset) -> tzoffset: ...
@@ -88,7 +94,6 @@ def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...)
def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ...
def resolve_imaginary(dt: datetime.datetime) -> datetime.datetime: ...
class _GetTZ:
def __call__(self, name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ...
def nocache(self, name: Optional[Text]) -> Optional[datetime.tzinfo]: ...
+1 -2
View File
@@ -1,6 +1,5 @@
from datetime import datetime, timedelta, tzinfo
from typing import Optional
from datetime import datetime, tzinfo, timedelta
def default_tzinfo(dt: datetime, tzinfo: tzinfo) -> datetime: ...
def today(tzinfo: Optional[tzinfo] = ...) -> datetime: ...
+6 -8
View File
@@ -51,15 +51,11 @@ class FunctionMaker(object):
defaults: Optional[Tuple[Any, ...]] = ...,
doc: Optional[Text] = ...,
module: Optional[Text] = ...,
funcdict: Optional[Dict[Text, Any]] = ...
funcdict: Optional[Dict[Text, Any]] = ...,
) -> None: ...
def update(self, func: Any, **kw: Any) -> None: ...
def make(
self,
src_templ: Text,
evaldict: Optional[Dict[Text, Any]] = ...,
addsource: bool = ...,
**attrs: Any
self, src_templ: Text, evaldict: Optional[Dict[Text, Any]] = ..., addsource: bool = ..., **attrs: Any
) -> Callable[..., Any]: ...
@classmethod
def create(
@@ -71,11 +67,13 @@ class FunctionMaker(object):
doc: Optional[Text] = ...,
module: Optional[Text] = ...,
addsource: bool = ...,
**attrs: Any
**attrs: Any,
) -> Callable[..., Any]: ...
def decorate(func: _Func, caller: Callable[..., Any], extras: Any = ...) -> _Func: ...
def decorator(caller: Callable[..., Any], _func: Optional[Callable[..., Any]] = ...) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...
def decorator(
caller: Callable[..., Any], _func: Optional[Callable[..., Any]] = ...
) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...
class ContextManager(_GeneratorContextManager[_T]):
def __call__(self, func: _C) -> _C: ...

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