Improve pywin32.isapi (#13889)

This commit is contained in:
Semyon Moroz
2025-04-28 15:34:51 +04:00
committed by GitHub
parent 8bfae3303f
commit 6759cb19e6
5 changed files with 126 additions and 123 deletions
+4 -6
View File
@@ -1,10 +1,8 @@
from _typeshed import Incomplete
class ISAPIError(Exception):
errno: Incomplete
strerror: Incomplete
funcname: Incomplete
def __init__(self, errno, strerror: Incomplete | None = None, funcname: Incomplete | None = None) -> None: ...
errno: int
strerror: str | None
funcname: str | None
def __init__(self, errno: int, strerror: str | None = None, funcname: str | None = None) -> None: ...
class FilterError(ISAPIError): ...
class ExtensionError(ISAPIError): ...
+24 -21
View File
@@ -1,6 +1,9 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsGetItem, Unused
from collections.abc import Callable, Iterable, Mapping
from optparse import OptionParser
from typing import Final, Literal
this_dir: Incomplete
this_dir: str
class FilterParameters:
Name: Incomplete
@@ -33,8 +36,8 @@ class VirtualDirParameters:
ScriptMapUpdate: str
Server: Incomplete
def __init__(self, **kw) -> None: ...
def is_root(self): ...
def split_path(self): ...
def is_root(self) -> bool: ...
def split_path(self) -> list[str]: ...
class ScriptMapParams:
Extension: Incomplete
@@ -56,43 +59,43 @@ class ISAPIParameters:
verbose: int
def log(level, what) -> None: ...
def log(level: int, what: object) -> None: ...
class InstallationError(Exception): ...
class ItemNotFound(InstallationError): ...
class ConfigurationError(InstallationError): ...
def FindPath(options, server, name): ...
def LocateWebServerPath(description): ...
def GetWebServer(description: Incomplete | None = None): ...
def FindPath(options, server: str | bytes | bytearray, name: str) -> str: ...
def LocateWebServerPath(description: str): ...
def GetWebServer(description: str | None = None): ...
def LoadWebServer(path): ...
def FindWebServer(options, server_desc): ...
def split_path(path): ...
def FindWebServer(options, server_desc: str | bytes | bytearray | None) -> str: ...
def split_path(path: str) -> list[str]: ...
def CreateDirectory(params, options): ...
def AssignScriptMaps(script_maps, target, update: str = "replace") -> None: ...
def AssignScriptMaps(script_maps: Iterable[ScriptMapParams], target, update: str = "replace") -> None: ...
def get_unique_items(sequence, reference): ...
def CreateISAPIFilter(filterParams, options): ...
def DeleteISAPIFilter(filterParams, options) -> None: ...
def AddExtensionFiles(params, options) -> None: ...
def DeleteExtensionFileRecords(params, options) -> None: ...
def CheckLoaderModule(dll_name) -> None: ...
def CheckLoaderModule(dll_name: StrOrBytesPath) -> None: ...
def Install(params, options) -> None: ...
def RemoveDirectory(params, options) -> None: ...
def RemoveScriptMaps(vd_params, options) -> None: ...
def Uninstall(params, options) -> None: ...
def GetLoaderModuleName(mod_name, check_module: Incomplete | None = None): ...
def InstallModule(conf_module_name, params, options, log=...) -> None: ...
def UninstallModule(conf_module_name, params, options, log=...) -> None: ...
def GetLoaderModuleName(mod_name: StrPath, check_module: bool | None = None) -> str: ...
def InstallModule(conf_module_name: StrPath, params, options, log: Callable[[int, str], Unused] = ...) -> None: ...
def UninstallModule(conf_module_name: StrPath, params, options, log: Callable[[int, str], Unused] = ...) -> None: ...
standard_arguments: Incomplete
standard_arguments: Final[dict[Literal["install", "remove"], Callable[..., Incomplete]]]
def build_usage(handler_map): ...
def build_usage(handler_map: Mapping[str, object]) -> str: ...
def MergeStandardOptions(options, params) -> None: ...
def HandleCommandLine(
params,
argv: Incomplete | None = None,
conf_module_name: Incomplete | None = None,
argv: SupportsGetItem[int, str] | None = None,
conf_module_name: str | None = None,
default_arg: str = "install",
opt_parser: Incomplete | None = None,
custom_arg_handlers={},
opt_parser: OptionParser | None = None,
custom_arg_handlers: Mapping[str, object] = {},
) -> None: ...
+85 -85
View File
@@ -1,86 +1,86 @@
from _typeshed import Incomplete
from typing import Final
HTTP_CONTINUE: int
HTTP_SWITCHING_PROTOCOLS: int
HTTP_PROCESSING: int
HTTP_OK: int
HTTP_CREATED: int
HTTP_ACCEPTED: int
HTTP_NON_AUTHORITATIVE: int
HTTP_NO_CONTENT: int
HTTP_RESET_CONTENT: int
HTTP_PARTIAL_CONTENT: int
HTTP_MULTI_STATUS: int
HTTP_MULTIPLE_CHOICES: int
HTTP_MOVED_PERMANENTLY: int
HTTP_MOVED_TEMPORARILY: int
HTTP_SEE_OTHER: int
HTTP_NOT_MODIFIED: int
HTTP_USE_PROXY: int
HTTP_TEMPORARY_REDIRECT: int
HTTP_BAD_REQUEST: int
HTTP_UNAUTHORIZED: int
HTTP_PAYMENT_REQUIRED: int
HTTP_FORBIDDEN: int
HTTP_NOT_FOUND: int
HTTP_METHOD_NOT_ALLOWED: int
HTTP_NOT_ACCEPTABLE: int
HTTP_PROXY_AUTHENTICATION_REQUIRED: int
HTTP_REQUEST_TIME_OUT: int
HTTP_CONFLICT: int
HTTP_GONE: int
HTTP_LENGTH_REQUIRED: int
HTTP_PRECONDITION_FAILED: int
HTTP_REQUEST_ENTITY_TOO_LARGE: int
HTTP_REQUEST_URI_TOO_LARGE: int
HTTP_UNSUPPORTED_MEDIA_TYPE: int
HTTP_RANGE_NOT_SATISFIABLE: int
HTTP_EXPECTATION_FAILED: int
HTTP_UNPROCESSABLE_ENTITY: int
HTTP_INTERNAL_SERVER_ERROR: int
HTTP_NOT_IMPLEMENTED: int
HTTP_BAD_GATEWAY: int
HTTP_SERVICE_UNAVAILABLE: int
HTTP_GATEWAY_TIME_OUT: int
HTTP_VERSION_NOT_SUPPORTED: int
HTTP_VARIANT_ALSO_VARIES: int
HSE_STATUS_SUCCESS: int
HSE_STATUS_SUCCESS_AND_KEEP_CONN: int
HSE_STATUS_PENDING: int
HSE_STATUS_ERROR: int
SF_NOTIFY_SECURE_PORT: int
SF_NOTIFY_NONSECURE_PORT: int
SF_NOTIFY_READ_RAW_DATA: int
SF_NOTIFY_PREPROC_HEADERS: int
SF_NOTIFY_AUTHENTICATION: int
SF_NOTIFY_URL_MAP: int
SF_NOTIFY_ACCESS_DENIED: int
SF_NOTIFY_SEND_RESPONSE: int
SF_NOTIFY_SEND_RAW_DATA: int
SF_NOTIFY_LOG: int
SF_NOTIFY_END_OF_REQUEST: int
SF_NOTIFY_END_OF_NET_SESSION: int
SF_NOTIFY_ORDER_HIGH: int
SF_NOTIFY_ORDER_MEDIUM: int
SF_NOTIFY_ORDER_LOW: int
SF_NOTIFY_ORDER_DEFAULT: int
SF_NOTIFY_ORDER_MASK: Incomplete
SF_STATUS_REQ_FINISHED: int
SF_STATUS_REQ_FINISHED_KEEP_CONN: Incomplete
SF_STATUS_REQ_NEXT_NOTIFICATION: Incomplete
SF_STATUS_REQ_HANDLED_NOTIFICATION: Incomplete
SF_STATUS_REQ_ERROR: Incomplete
SF_STATUS_REQ_READ_NEXT: Incomplete
HSE_IO_SYNC: int
HSE_IO_ASYNC: int
HSE_IO_DISCONNECT_AFTER_SEND: int
HSE_IO_SEND_HEADERS: int
HSE_IO_NODELAY: int
HSE_IO_FINAL_SEND: int
HSE_IO_CACHE_RESPONSE: int
HSE_EXEC_URL_NO_HEADERS: int
HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR: int
HSE_EXEC_URL_IGNORE_VALIDATION_AND_RANGE: int
HSE_EXEC_URL_DISABLE_CUSTOM_ERROR: int
HSE_EXEC_URL_SSI_CMD: int
HSE_EXEC_URL_HTTP_CACHE_ELIGIBLE: int
HTTP_CONTINUE: Final = 100
HTTP_SWITCHING_PROTOCOLS: Final = 101
HTTP_PROCESSING: Final = 102
HTTP_OK: Final = 200
HTTP_CREATED: Final = 201
HTTP_ACCEPTED: Final = 202
HTTP_NON_AUTHORITATIVE: Final = 203
HTTP_NO_CONTENT: Final = 204
HTTP_RESET_CONTENT: Final = 205
HTTP_PARTIAL_CONTENT: Final = 206
HTTP_MULTI_STATUS: Final = 207
HTTP_MULTIPLE_CHOICES: Final = 300
HTTP_MOVED_PERMANENTLY: Final = 301
HTTP_MOVED_TEMPORARILY: Final = 302
HTTP_SEE_OTHER: Final = 303
HTTP_NOT_MODIFIED: Final = 304
HTTP_USE_PROXY: Final = 305
HTTP_TEMPORARY_REDIRECT: Final = 307
HTTP_BAD_REQUEST: Final = 400
HTTP_UNAUTHORIZED: Final = 401
HTTP_PAYMENT_REQUIRED: Final = 402
HTTP_FORBIDDEN: Final = 403
HTTP_NOT_FOUND: Final = 404
HTTP_METHOD_NOT_ALLOWED: Final = 405
HTTP_NOT_ACCEPTABLE: Final = 406
HTTP_PROXY_AUTHENTICATION_REQUIRED: Final = 407
HTTP_REQUEST_TIME_OUT: Final = 408
HTTP_CONFLICT: Final = 409
HTTP_GONE: Final = 410
HTTP_LENGTH_REQUIRED: Final = 411
HTTP_PRECONDITION_FAILED: Final = 412
HTTP_REQUEST_ENTITY_TOO_LARGE: Final = 413
HTTP_REQUEST_URI_TOO_LARGE: Final = 414
HTTP_UNSUPPORTED_MEDIA_TYPE: Final = 415
HTTP_RANGE_NOT_SATISFIABLE: Final = 416
HTTP_EXPECTATION_FAILED: Final = 417
HTTP_UNPROCESSABLE_ENTITY: Final = 422
HTTP_INTERNAL_SERVER_ERROR: Final = 500
HTTP_NOT_IMPLEMENTED: Final = 501
HTTP_BAD_GATEWAY: Final = 502
HTTP_SERVICE_UNAVAILABLE: Final = 503
HTTP_GATEWAY_TIME_OUT: Final = 504
HTTP_VERSION_NOT_SUPPORTED: Final = 505
HTTP_VARIANT_ALSO_VARIES: Final = 506
HSE_STATUS_SUCCESS: Final = 1
HSE_STATUS_SUCCESS_AND_KEEP_CONN: Final = 2
HSE_STATUS_PENDING: Final = 3
HSE_STATUS_ERROR: Final = 4
SF_NOTIFY_SECURE_PORT: Final = 0x00000001
SF_NOTIFY_NONSECURE_PORT: Final = 0x00000002
SF_NOTIFY_READ_RAW_DATA: Final = 0x00008000
SF_NOTIFY_PREPROC_HEADERS: Final = 0x00004000
SF_NOTIFY_AUTHENTICATION: Final = 0x00002000
SF_NOTIFY_URL_MAP: Final = 0x00001000
SF_NOTIFY_ACCESS_DENIED: Final = 0x00000800
SF_NOTIFY_SEND_RESPONSE: Final = 0x00000040
SF_NOTIFY_SEND_RAW_DATA: Final = 0x00000400
SF_NOTIFY_LOG: Final = 0x00000200
SF_NOTIFY_END_OF_REQUEST: Final = 0x00000080
SF_NOTIFY_END_OF_NET_SESSION: Final = 0x00000100
SF_NOTIFY_ORDER_HIGH: Final = 0x00080000
SF_NOTIFY_ORDER_MEDIUM: Final = 0x00040000
SF_NOTIFY_ORDER_LOW: Final = 0x00020000
SF_NOTIFY_ORDER_DEFAULT: Final = SF_NOTIFY_ORDER_LOW
SF_NOTIFY_ORDER_MASK: Final = 917504
SF_STATUS_REQ_FINISHED: Final = 134217728
SF_STATUS_REQ_FINISHED_KEEP_CONN: Final = 134217729
SF_STATUS_REQ_NEXT_NOTIFICATION: Final = 134217730
SF_STATUS_REQ_HANDLED_NOTIFICATION: Final = 134217731
SF_STATUS_REQ_ERROR: Final = 134217732
SF_STATUS_REQ_READ_NEXT: Final = 134217733
HSE_IO_SYNC: Final = 0x00000001
HSE_IO_ASYNC: Final = 0x00000002
HSE_IO_DISCONNECT_AFTER_SEND: Final = 0x00000004
HSE_IO_SEND_HEADERS: Final = 0x00000008
HSE_IO_NODELAY: Final = 0x00001000
HSE_IO_FINAL_SEND: Final = 0x00000010
HSE_IO_CACHE_RESPONSE: Final = 0x00000020
HSE_EXEC_URL_NO_HEADERS: Final = 0x02
HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR: Final = 0x04
HSE_EXEC_URL_IGNORE_VALIDATION_AND_RANGE: Final = 0x10
HSE_EXEC_URL_DISABLE_CUSTOM_ERROR: Final = 0x20
HSE_EXEC_URL_SSI_CMD: Final = 0x40
HSE_EXEC_URL_HTTP_CACHE_ELIGIBLE: Final = 0x80
+1 -1
View File
@@ -1,6 +1,6 @@
class SimpleExtension:
def GetExtensionVersion(self, vi) -> None: ...
def HttpExtensionProc(self, control_block) -> None: ...
def HttpExtensionProc(self, control_block) -> int | None: ...
def TerminateExtension(self, status) -> None: ...
class SimpleFilter:
+12 -10
View File
@@ -1,26 +1,28 @@
import threading
from _typeshed import Incomplete
from _typeshed import Unused
from collections.abc import Callable
from typing import Final
import isapi.simple
ISAPI_REQUEST: int
ISAPI_SHUTDOWN: int
ISAPI_REQUEST: Final = 1
ISAPI_SHUTDOWN: Final = 2
class WorkerThread(threading.Thread):
running: bool
io_req_port: Incomplete
extension: Incomplete
def __init__(self, extension, io_req_port) -> None: ...
io_req_port: int
extension: ThreadPoolExtension
def __init__(self, extension: ThreadPoolExtension, io_req_port: int) -> None: ...
def call_handler(self, cblock) -> None: ...
class ThreadPoolExtension(isapi.simple.SimpleExtension):
max_workers: int
worker_shutdown_wait: int
workers: Incomplete
dispatch_map: Incomplete
io_req_port: Incomplete
workers: list[WorkerThread]
dispatch_map: dict[int, Callable[..., Unused]]
io_req_port: int
def GetExtensionVersion(self, vi) -> None: ...
def HttpExtensionProc(self, control_block): ...
def HttpExtensionProc(self, control_block) -> int: ...
def TerminateExtension(self, status) -> None: ...
def DispatchConnection(self, errCode, bytes, key, overlapped) -> None: ...
def Dispatch(self, ecb) -> None: ...