chore: コードのフォーマット

pull/31/head
yupix 2 years ago
parent 9616a20c78
commit 5c514383bd
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -9,16 +9,18 @@ from mipac.models.note import Note
if TYPE_CHECKING: if TYPE_CHECKING:
from mipac.manager.client import ClientActions from mipac.manager.client import ClientActions
from mipac.manager.follow import FollowManager, FollowRequestManager from mipac.manager.follow import FollowManager, FollowRequestManager
from mipac.types.notification import INotification, IUserNf, \ from mipac.types.notification import (
INoteNf, IPollEndNf, IReactionNf INotification,
IUserNf,
INoteNf,
IPollEndNf,
IReactionNf,
)
class Notification: class Notification:
def __init__( def __init__(
self, self, notification: INotification, *, client: ClientActions,
notification: INotification,
*,
client: ClientActions,
) -> None: ) -> None:
self.__notification: INotification = notification self.__notification: INotification = notification
self.__client: ClientActions = client self.__client: ClientActions = client
@ -44,10 +46,7 @@ class Notification:
class NotificationFollow(Notification): class NotificationFollow(Notification):
def __init__( def __init__(
self, self, notification: IUserNf, *, client: ClientActions,
notification: IUserNf,
*,
client: ClientActions,
) -> None: ) -> None:
super().__init__(notification, client=client) super().__init__(notification, client=client)
self.__notification: IUserNf = notification self.__notification: IUserNf = notification
@ -55,9 +54,7 @@ class NotificationFollow(Notification):
@property @property
def user(self) -> LiteUser: def user(self) -> LiteUser:
return LiteUser( return LiteUser(self.__notification['user'], client=self.__client,)
self.__notification['user'], client=self.__client,
)
@property @property
def user_id(self) -> str: def user_id(self) -> str:
@ -65,17 +62,12 @@ class NotificationFollow(Notification):
@property @property
def api(self) -> FollowManager: def api(self) -> FollowManager:
return self.__client._create_user_instance( return self.__client._create_user_instance(user=self.user).follow
user=self.user
).follow
class NotificationFollowRequest(Notification): class NotificationFollowRequest(Notification):
def __init__( def __init__(
self, self, notification: IUserNf, *, client: ClientActions,
notification: IUserNf,
*,
client: ClientActions,
) -> None: ) -> None:
super().__init__(notification, client=client) super().__init__(notification, client=client)
self.__notification: IUserNf = notification self.__notification: IUserNf = notification
@ -83,9 +75,7 @@ class NotificationFollowRequest(Notification):
@property @property
def user(self) -> LiteUser: def user(self) -> LiteUser:
return LiteUser( return LiteUser(self.__notification['user'], client=self.__client,)
self.__notification['user'], client=self.__client,
)
@property @property
def user_id(self) -> str: def user_id(self) -> str:
@ -100,10 +90,7 @@ class NotificationFollowRequest(Notification):
class NotificationNote(Notification): class NotificationNote(Notification):
def __init__( def __init__(
self, self, notification: INoteNf, *, client: ClientActions,
notification: INoteNf,
*,
client: ClientActions,
) -> None: ) -> None:
super().__init__(notification, client=client) super().__init__(notification, client=client)
self.__notification: INoteNf = notification self.__notification: INoteNf = notification
@ -111,9 +98,7 @@ class NotificationNote(Notification):
@property @property
def user(self) -> LiteUser: def user(self) -> LiteUser:
return LiteUser( return LiteUser(self.__notification['user'], client=self.__client,)
self.__notification['user'], client=self.__client,
)
@property @property
def user_id(self) -> str: def user_id(self) -> str:
@ -121,17 +106,12 @@ class NotificationNote(Notification):
@property @property
def note(self) -> Note: def note(self) -> Note:
return Note( return Note(self.__notification['note'], client=self.__client,)
self.__notification['note'], client=self.__client,
)
class NotificationPollEnd(Notification): class NotificationPollEnd(Notification):
def __init__( def __init__(
self, self, notification: IPollEndNf, *, client: ClientActions,
notification: IPollEndNf,
*,
client: ClientActions,
) -> None: ) -> None:
super().__init__(notification, client=client) super().__init__(notification, client=client)
self.__notification: IPollEndNf = notification self.__notification: IPollEndNf = notification
@ -139,9 +119,7 @@ class NotificationPollEnd(Notification):
@property @property
def note(self) -> Note: def note(self) -> Note:
return Note( return Note(self.__notification['note'], client=self.__client,)
self.__notification['note'], client=self.__client,
)
class NotificationReaction(Notification): class NotificationReaction(Notification):

Loading…
Cancel
Save