1
1
import datetime
2
2
import uuid
3
- from typing import IO , Any , Callable , Generic , Iterable , List , Optional , Text , Tuple as _PyTuple , Type , TypeVar , Union
3
+ from typing import IO , Any , Callable , Generic , Iterable , List , Optional , Sequence , Text , Tuple as _PyTuple , Type , TypeVar , Union
4
4
5
5
from click .core import Context , Parameter , _ConvertibleType , _ParamType
6
6
@@ -15,20 +15,30 @@ class CompositeParamType(ParamType):
15
15
16
16
class Choice (ParamType ):
17
17
choices : Iterable [str ]
18
+ case_sensitive : bool
18
19
def __init__ (self , choices : Iterable [str ], case_sensitive : bool = ...) -> None : ...
19
20
20
21
class DateTime (ParamType ):
21
- def __init__ (self , formats : Optional [List [str ]] = ...) -> None : ...
22
+ formats : Sequence [str ]
23
+ def __init__ (self , formats : Optional [Sequence [str ]] = ...) -> None : ...
22
24
def convert (self , value : str , param : Optional [Parameter ], ctx : Optional [Context ]) -> datetime .datetime : ...
23
25
24
26
class FloatParamType (ParamType ):
25
27
def __call__ (self , value : Optional [str ], param : Optional [Parameter ] = ..., ctx : Optional [Context ] = ...) -> float : ...
26
28
def convert (self , value : str , param : Optional [Parameter ], ctx : Optional [Context ]) -> float : ...
27
29
28
30
class FloatRange (FloatParamType ):
31
+ min : Optional [float ]
32
+ max : Optional [float ]
33
+ clamp : bool
29
34
def __init__ (self , min : Optional [float ] = ..., max : Optional [float ] = ..., clamp : bool = ...) -> None : ...
30
35
31
36
class File (ParamType ):
37
+ mode : str
38
+ encoding : Optional [str ]
39
+ errors : Optional [str ]
40
+ lazy : Optional [bool ]
41
+ atomic : bool
32
42
def __init__ (
33
43
self ,
34
44
mode : Text = ...,
@@ -55,11 +65,23 @@ class IntParamType(ParamType):
55
65
def convert (self , value : str , param : Optional [Parameter ], ctx : Optional [Context ]) -> int : ...
56
66
57
67
class IntRange (IntParamType ):
68
+ min : Optional [int ]
69
+ max : Optional [int ]
70
+ clamp : bool
58
71
def __init__ (self , min : Optional [int ] = ..., max : Optional [int ] = ..., clamp : bool = ...) -> None : ...
59
72
60
73
_PathType = TypeVar ("_PathType" , str , bytes )
74
+ _PathTypeBound = Union [Type [str ], Type [bytes ]]
61
75
62
76
class Path (ParamType ):
77
+ exists : bool
78
+ file_okay : bool
79
+ dir_okay : bool
80
+ writable : bool
81
+ readable : bool
82
+ resolve_path : bool
83
+ allow_dash : bool
84
+ type : Optional [_PathTypeBound ]
63
85
def __init__ (
64
86
self ,
65
87
exists : bool = ...,
0 commit comments