ruff format
This commit is contained in:
@@ -349,8 +349,7 @@ def parse_content_header(value: str) -> Tuple[str, Options]:
|
||||
options: Dict[str, Union[int, str]] = {}
|
||||
else:
|
||||
options = {
|
||||
m.group(1)
|
||||
.lower(): (m.group(2) or m.group(3))
|
||||
m.group(1).lower(): (m.group(2) or m.group(3))
|
||||
.replace("%22", '"')
|
||||
.replace("%0D%0A", "\n")
|
||||
for m in _param.finditer(value[pos:])
|
||||
|
||||
@@ -14,7 +14,7 @@ class ExceptionMixin(metaclass=SanicMeta):
|
||||
def exception(
|
||||
self,
|
||||
*exceptions: Union[Type[Exception], List[Type[Exception]]],
|
||||
apply: bool = True
|
||||
apply: bool = True,
|
||||
) -> Callable:
|
||||
"""Decorator used to register an exception handler for the current application or blueprint instance.
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class MiddlewareMixin(metaclass=SanicMeta):
|
||||
attach_to: str = "request",
|
||||
apply: bool = True,
|
||||
*,
|
||||
priority: int = 0
|
||||
priority: int = 0,
|
||||
) -> MiddlewareType:
|
||||
...
|
||||
|
||||
@@ -36,7 +36,7 @@ class MiddlewareMixin(metaclass=SanicMeta):
|
||||
attach_to: str = "request",
|
||||
apply: bool = True,
|
||||
*,
|
||||
priority: int = 0
|
||||
priority: int = 0,
|
||||
) -> Callable[[MiddlewareType], MiddlewareType]:
|
||||
...
|
||||
|
||||
@@ -46,7 +46,7 @@ class MiddlewareMixin(metaclass=SanicMeta):
|
||||
attach_to: str = "request",
|
||||
apply: bool = True,
|
||||
*,
|
||||
priority: int = 0
|
||||
priority: int = 0,
|
||||
) -> Union[MiddlewareType, Callable[[MiddlewareType], MiddlewareType]]:
|
||||
"""Decorator for registering middleware.
|
||||
|
||||
|
||||
@@ -44,12 +44,8 @@ class ConnInfo:
|
||||
self.server_name = ""
|
||||
self.cert: Dict[str, Any] = {}
|
||||
self.network_paths: List[Any] = []
|
||||
sslobj: Optional[SSLObject] = transport.get_extra_info(
|
||||
"ssl_object"
|
||||
) # type: ignore
|
||||
sslctx: Optional[SSLContext] = transport.get_extra_info(
|
||||
"ssl_context"
|
||||
) # type: ignore
|
||||
sslobj: Optional[SSLObject] = transport.get_extra_info("ssl_object") # type: ignore
|
||||
sslctx: Optional[SSLContext] = transport.get_extra_info("ssl_context") # type: ignore
|
||||
if sslobj:
|
||||
self.ssl = True
|
||||
self.server_name = getattr(sslobj, "sanic_server_name", None) or ""
|
||||
|
||||
@@ -57,9 +57,7 @@ class WebsocketFrameAssembler:
|
||||
self.read_mutex = asyncio.Lock()
|
||||
self.write_mutex = asyncio.Lock()
|
||||
|
||||
self.completed_queue = asyncio.Queue(
|
||||
maxsize=1
|
||||
) # type: asyncio.Queue[Data]
|
||||
self.completed_queue = asyncio.Queue(maxsize=1) # type: asyncio.Queue[Data]
|
||||
|
||||
# put() sets this event to tell get() that a message can be fetched.
|
||||
self.message_complete = asyncio.Event()
|
||||
|
||||
Reference in New Issue
Block a user