🎨 sort imports in file

This commit is contained in:
Mix 2021-01-30 06:10:04 +08:00
parent 02af1c1227
commit 5de41a18f9
5 changed files with 14 additions and 7 deletions

View File

@ -58,6 +58,7 @@ class WebSocket(BaseWebSocket):
try: try:
data = await self.receive() data = await self.receive()
except websockets.ConnectionClosedOK: except websockets.ConnectionClosedOK:
logger.debug(f'Websocket connection {self.websocket} closed')
break break
except Exception as e: except Exception as e:
logger.exception(f'Websocket client listened {self.websocket} ' logger.exception(f'Websocket client listened {self.websocket} '

View File

@ -1,12 +1,14 @@
import json
from enum import Enum from enum import Enum
from typing import Dict, Any, Optional, Type from typing import Any, Dict, Optional, Type
from pydantic import BaseModel, Field, ValidationError from pydantic import BaseModel, Field, ValidationError
from typing_extensions import Literal from typing_extensions import Literal
from nonebot.adapters import Event as BaseEvent from nonebot.adapters import Event as BaseEvent
from nonebot.adapters import Message as BaseMessage from nonebot.adapters import Message as BaseMessage
from nonebot.typing import overrides
from nonebot.log import logger from nonebot.log import logger
from nonebot.typing import overrides
class SenderPermission(str, Enum): class SenderPermission(str, Enum):
@ -104,3 +106,6 @@ class Event(BaseEvent):
@overrides(BaseEvent) @overrides(BaseEvent)
def is_tome(self) -> bool: def is_tome(self) -> bool:
return False return False
def normalize_dict(self, **kwargs) -> Dict[str, Any]:
return json.loads(self.json(**kwargs))

View File

@ -1,10 +1,11 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from pydantic import Field from pydantic import Field
from .base import Event, SenderInfo, PrivateSenderInfo
from nonebot.typing import overrides
from ..message import MessageChain from ..message import MessageChain
from nonebot.typing import overrides from .base import Event, PrivateSenderInfo, SenderInfo
class MessageEvent(Event): class MessageEvent(Event):

View File

@ -1,4 +1,4 @@
from typing import Optional, Any from typing import Any, Optional
from pydantic import Field from pydantic import Field

View File

@ -1,5 +1,5 @@
from enum import Enum from enum import Enum
from typing import Any, Dict, List, Union, Iterable from typing import Any, Dict, Iterable, List, Union
from pydantic import validate_arguments from pydantic import validate_arguments