# Stubs for cyclone.web (Python 3) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from twisted.internet import protocol from typing import Any, List, Optional from .httpserver import HTTPRequest class RequestHandler: SUPPORTED_METHODS: Any = ... serialize_lists: bool = ... no_keep_alive: bool = ... xsrf_cookie_name: str = ... application: Any = ... request: HTTPRequest = ... path_args: Any = ... path_kwargs: Any = ... ui: Any = ... def __init__(self, application: Any, request: HTTPRequest, **kwargs: Any) -> None: ... @property def settings(self): ... def default(self, *args: Any, **kwargs: Any) -> None: ... def prepare(self) -> None: ... def on_finish(self) -> None: ... def on_connection_close(self, *args: Any, **kwargs: Any) -> None: ... def clear(self) -> None: ... def set_default_headers(self) -> None: ... def set_status(self, status_code: Any, reason: Optional[Any] = ...) -> None: ... def get_status(self): ... def set_header(self, name: Any, value: Any) -> None: ... def add_header(self, name: Any, value: Any) -> None: ... def clear_header(self, name: Any) -> None: ... def get_argument(self, name: Any, default: Any = ..., strip: bool = ...) -> str: ... def get_arguments(self, name: Any, strip: bool = ...) -> List[str]: ... def decode_argument(self, value: Any, name: Optional[Any] = ...): ... @property def cookies(self): ... def get_cookie(self, name: Any, default: Optional[Any] = ...): ... def set_cookie(self, name: Any, value: Any, domain: Optional[Any] = ..., expires: Optional[Any] = ..., path: str = ..., expires_days: Optional[Any] = ..., **kwargs: Any) -> None: ... def clear_cookie(self, name: Any, path: str = ..., domain: Optional[Any] = ...) -> None: ... def clear_all_cookies(self) -> None: ... def set_secure_cookie(self, name: Any, value: Any, expires_days: int = ..., **kwargs: Any) -> None: ... def create_signed_value(self, name: Any, value: Any): ... def get_secure_cookie(self, name: Any, value: Optional[Any] = ..., max_age_days: int = ...): ... def redirect(self, url: Any, permanent: bool = ..., status: Optional[Any] = ...) -> None: ... def write(self, chunk: Any) -> None: ... def render(self, template_name: Any, **kwargs: Any): ... def render_string(self, template_name: Any, **kwargs: Any): ... def get_template_namespace(self): ... def create_template_loader(self, template_path: Any): ... def flush(self, include_footers: bool = ...) -> None: ... def notifyFinish(self): ... def finish(self, chunk: Optional[Any] = ...) -> None: ... def send_error(self, status_code: int = ..., **kwargs: Any) -> None: ... def write_error(self, status_code: Any, **kwargs: Any) -> None: ... @property def locale(self): ... def get_user_locale(self) -> None: ... def get_browser_locale(self, default: str = ...): ... @property def current_user(self): ... def get_current_user(self) -> None: ... def get_login_url(self): ... def get_template_path(self): ... @property def xsrf_token(self): ... def check_xsrf_cookie(self) -> None: ... def xsrf_form_html(self): ... def static_url(self, path: Any, include_host: Optional[Any] = ...): ... def async_callback(self, callback: Any, *args: Any, **kwargs: Any): ... def require_setting(self, name: Any, feature: str = ...) -> None: ... def reverse_url(self, name: Any, *args: Any, **kwargs: Any): ... def compute_etag(self): ... def asynchronous(method: Any): ... def removeslash(method: Any): ... def addslash(method: Any): ... class Application(protocol.ServerFactory): protocol: Any = ... transforms: Any = ... handlers: Any = ... named_handlers: Any = ... error_handler: Any = ... default_host: Any = ... settings: Any = ... ui_modules: Any = ... ui_methods: Any = ... def __init__(self, handlers: Optional[Any] = ..., default_host: str = ..., transforms: Optional[Any] = ..., error_handler: Optional[Any] = ..., **settings: Any) -> None: ... def add_handlers(self, host_pattern: Any, host_handlers: Any) -> None: ... def add_transform(self, transform_class: Any) -> None: ... def __call__(self, request: Any): ... def reverse_url(self, name: Any, *args: Any, **kwargs: Any): ... def log_request(self, handler: Any) -> None: ... class HTTPError(Exception): status_code: Any = ... log_message: Any = ... args: Any = ... reason: Any = ... def __init__(self, status_code: Any, log_message: Optional[Any] = ..., *args: Any, **kwargs: Any) -> None: ... class HTTPAuthenticationRequired(HTTPError): status_code: int = ... log_message: Any = ... auth_type: Any = ... kwargs: Any = ... def __init__(self, log_message: Optional[Any] = ..., auth_type: str = ..., realm: str = ..., **kwargs: Any) -> None: ... class ErrorHandler(RequestHandler): def initialize(self, status_code: Any) -> None: ... def prepare(self) -> None: ... def check_xsrf_cookie(self) -> None: ... class RedirectHandler(RequestHandler): def initialize(self, url: Any, permanent: bool = ...) -> None: ... def get(self) -> None: ... class StaticFileHandler(RequestHandler): CACHE_MAX_AGE: Any = ... root: Any = ... default_filename: Any = ... def initialize(self, path: Any, default_filename: Optional[Any] = ...) -> None: ... @classmethod def reset(cls) -> None: ... def head(self, path: Any) -> None: ... def get(self, path: Any, include_body: bool = ...) -> None: ... def set_extra_headers(self, path: Any) -> None: ... def get_cache_time(self, path: Any, modified: Any, mime_type: Any): ... @classmethod def make_static_url(cls, settings: Any, path: Any): ... @classmethod def get_version(cls, settings: Any, path: Any): ... def parse_url_path(self, url_path: Any): ... class FallbackHandler(RequestHandler): fallback: Any = ... def initialize(self, fallback: Any) -> None: ... def prepare(self) -> None: ... class OutputTransform: def __init__(self, request: Any) -> None: ... def transform_first_chunk(self, status_code: Any, headers: Any, chunk: Any, finishing: Any): ... def transform_chunk(self, chunk: Any, finishing: Any): ... class GZipContentEncoding(OutputTransform): CONTENT_TYPES: Any = ... MIN_LENGTH: int = ... def __init__(self, request: Any) -> None: ... def transform_first_chunk(self, status_code: Any, headers: Any, chunk: Any, finishing: Any): ... def transform_chunk(self, chunk: Any, finishing: Any): ... class ChunkedTransferEncoding(OutputTransform): def __init__(self, request: Any) -> None: ... def transform_first_chunk(self, status_code: Any, headers: Any, chunk: Any, finishing: Any): ... def transform_chunk(self, block: Any, finishing: Any): ... def authenticated(method: Any): ... class URLReverseError(Exception): ... class URLSpec: regex: Any = ... handler_class: Any = ... kwargs: Any = ... name: Any = ... def __init__(self, pattern: Any, handler_class: Any, kwargs: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... def reverse(self, *args: Any, **kwargs: Any): ... url = URLSpec def create_signed_value(secret: Any, name: Any, value: Any): ... def decode_signed_value(secret: Any, name: Any, value: Any, max_age_days: int = ...): ...