mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 18:13:36 +08:00
Fix several Flask types (#2858)
* Flask.static_folder is Optional * Fix some types in Flask
This commit is contained in:
committed by
Sebastian Rittau
parent
b71ccbb136
commit
d595a46912
27
third_party/2and3/flask/app.pyi
vendored
27
third_party/2and3/flask/app.pyi
vendored
@@ -13,7 +13,8 @@ from .signals import appcontext_tearing_down, got_request_exception, request_fin
|
||||
from .templating import DispatchingJinjaLoader, Environment
|
||||
from .wrappers import Request, Response
|
||||
from .testing import FlaskClient
|
||||
from typing import Any, Callable, ContextManager, Dict, List, Optional, Type, TypeVar, Union
|
||||
from typing import Any, Callable, ContextManager, Dict, List, Optional, Type, TypeVar, Union, Text
|
||||
from datetime import timedelta
|
||||
|
||||
def setupmethod(f: Any): ...
|
||||
|
||||
@@ -26,10 +27,10 @@ class Flask(_PackageBoundObject):
|
||||
app_ctx_globals_class: type = ...
|
||||
config_class: Type[Config] = ...
|
||||
testing: Any = ...
|
||||
secret_key: Any = ...
|
||||
secret_key: Union[Text, bytes, None] = ...
|
||||
session_cookie_name: Any = ...
|
||||
permanent_session_lifetime: Any = ...
|
||||
send_file_max_age_default: Any = ...
|
||||
permanent_session_lifetime: timedelta = ...
|
||||
send_file_max_age_default: timedelta = ...
|
||||
use_x_sendfile: Any = ...
|
||||
json_encoder: Any = ...
|
||||
json_decoder: Any = ...
|
||||
@@ -41,10 +42,10 @@ class Flask(_PackageBoundObject):
|
||||
session_interface: Any = ...
|
||||
import_name: str = ...
|
||||
template_folder: str = ...
|
||||
root_path: Any = ...
|
||||
root_path: Optional[Union[str, Text]] = ...
|
||||
static_url_path: Any = ...
|
||||
static_folder: str = ...
|
||||
instance_path: Any = ...
|
||||
static_folder: Optional[str] = ...
|
||||
instance_path: Union[str, Text] = ...
|
||||
config: Config = ...
|
||||
view_functions: Any = ...
|
||||
error_handler_spec: Any = ...
|
||||
@@ -63,11 +64,11 @@ class Flask(_PackageBoundObject):
|
||||
url_map: Any = ...
|
||||
subdomain_matching: Any = ...
|
||||
cli: Any = ...
|
||||
def __init__(self, import_name: str, static_url_path: Optional[str] = ..., static_folder: str = ..., static_host: Optional[str] = ..., host_matching: bool = ..., subdomain_matching: bool = ..., template_folder: str = ..., instance_path: Optional[str] = ..., instance_relative_config: bool = ..., root_path: Optional[str] = ...) -> None: ...
|
||||
def __init__(self, import_name: str, static_url_path: Optional[str] = ..., static_folder: Optional[str] = ..., static_host: Optional[str] = ..., host_matching: bool = ..., subdomain_matching: bool = ..., template_folder: str = ..., instance_path: Optional[str] = ..., instance_relative_config: bool = ..., root_path: Optional[str] = ...) -> None: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def propagate_exceptions(self): ...
|
||||
def propagate_exceptions(self) -> bool: ...
|
||||
@property
|
||||
def preserve_context_on_exception(self): ...
|
||||
@property
|
||||
@@ -75,18 +76,18 @@ class Flask(_PackageBoundObject):
|
||||
@property
|
||||
def jinja_env(self): ...
|
||||
@property
|
||||
def got_first_request(self): ...
|
||||
def got_first_request(self) -> bool: ...
|
||||
def make_config(self, instance_relative: bool = ...): ...
|
||||
def auto_find_instance_path(self): ...
|
||||
def open_instance_resource(self, resource: Any, mode: str = ...): ...
|
||||
def open_instance_resource(self, resource: Union[str, Text], mode: str = ...): ...
|
||||
templates_auto_reload: Any = ...
|
||||
def create_jinja_environment(self): ...
|
||||
def create_global_jinja_loader(self): ...
|
||||
def select_jinja_autoescape(self, filename: Any): ...
|
||||
def update_template_context(self, context: Any) -> None: ...
|
||||
def make_shell_context(self): ...
|
||||
env: Any = ...
|
||||
debug: Any = ...
|
||||
env: Optional[str] = ...
|
||||
debug: bool = ...
|
||||
def run(self, host: Optional[str] = ..., port: Optional[int] = ..., debug: Optional[bool] = ..., load_dotenv: bool = ..., **options: Any) -> None: ...
|
||||
def test_client(self, use_cookies: bool = ..., **kwargs: Any) -> FlaskClient: ...
|
||||
def test_cli_runner(self, **kwargs: Any): ...
|
||||
|
||||
Reference in New Issue
Block a user