mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 18:41:54 +08:00
lint fixes
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
import contextlib
|
||||
|
||||
from typing import Dict
|
||||
from typing import AsyncGenerator
|
||||
|
||||
import aiohttp
|
||||
|
||||
@@ -64,7 +65,7 @@ class KvmdClient:
|
||||
raise
|
||||
|
||||
@contextlib.asynccontextmanager
|
||||
async def ws(self, user: str, passwd: str) -> aiohttp.ClientWebSocketResponse: # pylint: disable=invalid-name
|
||||
async def ws(self, user: str, passwd: str) -> AsyncGenerator[aiohttp.ClientWebSocketResponse, None]:
|
||||
async with self.__make_session(user, passwd) as session:
|
||||
async with session.ws_connect(
|
||||
url=f"http://{self.__host}:{self.__port}/ws",
|
||||
|
||||
@@ -61,7 +61,9 @@ class StreamerClient:
|
||||
response.raise_for_status()
|
||||
reader = aiohttp.MultipartReader.from_response(response)
|
||||
while True:
|
||||
frame = await reader.next()
|
||||
frame = await reader.next() # pylint: disable=not-callable
|
||||
if not isinstance(frame, aiohttp.BodyPartReader):
|
||||
raise RuntimeError("Expected body part")
|
||||
yield (
|
||||
(frame.headers["X-UStreamer-Online"] == "true"),
|
||||
int(frame.headers["X-UStreamer-Width"]),
|
||||
|
||||
Reference in New Issue
Block a user