mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-02 11:01:53 +08:00
refactoring
This commit is contained in:
@@ -60,8 +60,8 @@ class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-inst
|
||||
# ===== WEBSOCKET
|
||||
|
||||
@exposed_http("GET", "/ws")
|
||||
async def __ws_handler(self, request: Request) -> WebSocketResponse:
|
||||
async with self._ws_session(request) as ws:
|
||||
async def __ws_handler(self, req: Request) -> WebSocketResponse:
|
||||
async with self._ws_session(req) as ws:
|
||||
await ws.send_event("loop", {})
|
||||
return (await self._ws_loop(ws))
|
||||
|
||||
@@ -128,9 +128,9 @@ class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-inst
|
||||
def __is_write_available(self) -> bool:
|
||||
try:
|
||||
return (not (os.statvfs(self.__data_path).f_flag & os.ST_RDONLY))
|
||||
except Exception as err:
|
||||
except Exception as ex:
|
||||
get_logger(0).info("Can't get filesystem state of PST (%s): %s",
|
||||
self.__data_path, tools.efmt(err))
|
||||
self.__data_path, tools.efmt(ex))
|
||||
return False
|
||||
|
||||
async def __remount_storage(self, rw: bool) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user