chore: docstringをformat

pull/134/head
yupix 7 months ago
parent f0ce0b0727
commit ff6836bf94
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -26,7 +26,6 @@ class AdminAccountActions(AbstractAction):
password : str
パスワード
"""
data = {"username": username, "password": password}
res = await self._session.request(
Route("POST", "/api/admin/accounts/create"),

@ -26,7 +26,6 @@ class AdminDriveActions(AbstractAction):
bool
Whether the remote files were cleaned
"""
res: bool = await self.__session.request(
Route("POST", "/api/admin/drive/clean-remote-files"), auth=True
)
@ -42,7 +41,6 @@ class AdminDriveActions(AbstractAction):
bool
Whether the drive was cleaned up
"""
res: bool = await self.__session.request(
Route("POST", "/api/admin/drive/cleanup"), auth=True
)
@ -84,7 +82,6 @@ class AdminDriveActions(AbstractAction):
list[File]
A list of files
"""
data = {
"limit": limit,
"sinceId": since_id,
@ -116,7 +113,6 @@ class AdminDriveActions(AbstractAction):
dict[str, Any]
The file
"""
data = {
"fileId": file_id,
"url": url,

@ -152,7 +152,6 @@ class AdminEmojiActions(AbstractAction):
NotExistRequiredData
Idが不足している
"""
emoji_id = emoji_id or self.__emoji_id
if emoji_id is None:

@ -139,7 +139,6 @@ class ClientAdminUserActions(SharedAdminUserActions):
bool
成功ならTrue
"""
user_id = user_id or self.__user_id
return await super().suspend(user_id=user_id)

@ -35,7 +35,6 @@ class SharedAntennaActions(AbstractAction):
bool
success or failure
"""
body = {"antennaId": antenna_id}
res: bool = await self._session.request(
Route("POST", "/api/antennas/delete"), auth=True, json=body
@ -322,7 +321,6 @@ class ClientAntennaActions(SharedAntennaActions):
Antenna
The created antenna.
"""
antenna_id = antenna_id or self.__antenna_id
return await super().update(
@ -390,7 +388,6 @@ class AntennaActions(SharedAntennaActions):
Antenna
The created antenna.
"""
if users is None:
users = [""]
if exclude_keywords is None:

@ -725,7 +725,6 @@ class ChannelActions(SharedChannelActions):
list[Channel]
取得したチャンネルのリスト
"""
raw_channels: list[IChannel] = await self._session.request(
Route("POST", "/api/channels/featured"), auth=True, lower=True
)
@ -754,7 +753,6 @@ class ChannelActions(SharedChannelActions):
AsyncGenerator[Channel, None]
取得したフォロー中のチャンネル
"""
body = {"sinceId": since_id, "untilId": until_id, "limit": limit}
pagination = Pagination[IChannel](
@ -816,7 +814,6 @@ class ChannelActions(SharedChannelActions):
AsyncGenerator[Channel, None]
取得した自分が所有しているチャンネル
"""
body = {"sinceId": since_id, "untilId": until_id, "limit": limit}
pagination = Pagination[IChannel](
@ -894,7 +891,6 @@ class ChannelActions(SharedChannelActions):
list[Channel]
見つかったチャンネルのリスト
"""
data = {
"query": query,
"type": type,

@ -44,6 +44,7 @@ class SharedClipActions(AbstractAction):
clip_id: str,
) -> AsyncGenerator[Note, None]:
"""Get notes from a clip
Parameters
----------
clip_id : str | None, optional, by default None
@ -158,7 +159,6 @@ class SharedClipActions(AbstractAction):
bool
True if the clip was updated, False otherwise
"""
body = {"clipId": clip_id, "name": name, "isPublic": is_public, "description": description}
result: IClip = await self._session.request(
Route("POST", "/api/clips/update"), json=body, auth=True
@ -196,6 +196,7 @@ class ClientClipActions(SharedClipActions):
clip_id: str | None = None,
) -> AsyncGenerator[Note, None]:
"""Get notes from a clip
Parameters
----------
clip_id : str | None, optional, by default None
@ -214,7 +215,6 @@ class ClientClipActions(SharedClipActions):
AsyncGenerator[Note, None]
The notes
"""
clip_id = clip_id or self._clip_id
async for note in super().get_all_notes(

@ -26,7 +26,6 @@ class DriveActions(AbstractAction):
DriveStatus
The status of the drive
"""
res: IDriveStatus = await self.__session.request(Route("POST", "/api/drive"), auth=True)
return DriveStatus(raw_drive_status=res, client=self.__client)
@ -57,7 +56,6 @@ class DriveActions(AbstractAction):
list[File]
A list of files
"""
params = {
"limit": limit,
"sinceId": since_id,

@ -192,7 +192,6 @@ class ClientFileActions(SharedFileActions):
list[Note]
The attached notes of the file
"""
file_id = file_id or self.__file_ids
return await super().get_attached_notes(
@ -231,7 +230,6 @@ class ClientFileActions(SharedFileActions):
bool
削除に成功したかどうか
"""
file_id = file_id or self.__file_ids
return await super().delete(file_id=file_id)
@ -316,7 +314,6 @@ class FileActions(SharedFileActions):
list[File]
The files of the drive
"""
data = {
"limit": limit,
"sinceId": since_id,
@ -372,7 +369,6 @@ class FileActions(SharedFileActions):
bool
存在するかしないか
"""
data = {"md5": md5}
res: bool = await self._session.request(
@ -414,7 +410,6 @@ class FileActions(SharedFileActions):
File
アップロードしたファイル
"""
if isinstance(file, io.IOBase):
if (file.seekable() and file.readable()) is False: # 書き込み/読み込みができるか確認
raise ValueError(f"File buffer {file!r} must be seekable and readable")
@ -455,7 +450,6 @@ class FileActions(SharedFileActions):
list[File]
見つかったファイル
"""
data = {"md5": md5}
raw_files: list[IFile] = await self._session.request(
@ -480,7 +474,6 @@ class FileActions(SharedFileActions):
list[File]
The found files
"""
data = {"name": name, "folderId": folder_id}
res: list[IFile] = await self._session.request(
@ -505,7 +498,6 @@ class FileActions(SharedFileActions):
File
取得したファイル
"""
data = {"fileId": file_id, "url": url}
res: IFile = await self._session.request(
@ -546,7 +538,6 @@ class FileActions(SharedFileActions):
bool
アップロードのリクエストに成功したかどうか
"""
data = {
"url": url,
"folderId": folder_id,

@ -417,7 +417,6 @@ class FolderActions(SharedFolderActions):
list[Folder]
The found folders
"""
data = {"name": name, "parentId": parent_id}
raw_folders: list[IFolder] = await self._session.request(
Route("POST", "/api/drive/folders/find"),

@ -132,7 +132,6 @@ class FollowRequestActions(AbstractAction):
list[FollowRequest]
List of follow requests
"""
res: list[IFollowRequest] = await self._session.request(
Route("POST", "/api/following/requests/list"),
auth=True,
@ -154,7 +153,6 @@ class FollowRequestActions(AbstractAction):
bool
Whether the request was accepted
"""
user_id = user_id or self.__user_id
data = {"userId": user_id}
@ -180,7 +178,6 @@ class FollowRequestActions(AbstractAction):
bool
Whether the request was rejected
"""
user_id = user_id or self.__user_id
data = {"userId": user_id}
@ -206,7 +203,6 @@ class FollowRequestActions(AbstractAction):
PartialUser
The user that you canceled to follow
"""
user_id = user_id or self.__user_id
data = {"userId": user_id}

@ -30,7 +30,6 @@ class SharedInviteActions(AbstractAction):
bool
Whether the invite code was deleted.
"""
res: bool = await self._session.request(
Route("POST", "/api/invite/delete"), json={"inviteId": invite_id}, auth=True
)
@ -57,7 +56,6 @@ class ClientInviteActions(SharedInviteActions):
bool
Whether the invite code was deleted.
"""
invite_id = invite_id or self._invite_id
return await super().delete(invite_id=invite_id)
@ -103,7 +101,6 @@ class InviteActions(SharedInviteActions):
list[PartialInviteCode]
The list of invite codes.
"""
data = {"limit": limit, "sinceId": since_id, "untilId": until_id}
raw_codes: list[IInviteCode] = await self._session.request(
@ -130,7 +127,6 @@ class InviteActions(SharedInviteActions):
list[PartialInviteCode]
The list of invite codes.
"""
data = {"limit": 100, "sinceId": since_id, "untilId": until_id}
pagination = Pagination[IInviteCode](
@ -151,7 +147,6 @@ class InviteActions(SharedInviteActions):
int
The number of invite codes you can create.
"""
raw_invite_limit: IInviteLimit = await self._session.request(
Route("POST", "/api/invite/limit"), auth=True
)

@ -338,7 +338,7 @@ class SharedNoteActions(AbstractAction):
Endpoint: `/api/notes/replies`
Parameters
---------
----------
since_id : str | None, default=None
since id
until_id : str | None, default=None
@ -377,7 +377,7 @@ class SharedNoteActions(AbstractAction):
Endpoint: `/api/notes/replies`
Parameters
---------
----------
since_id : str | None, default=None
since id
until_id : str | None, default=None
@ -536,7 +536,6 @@ class SharedNoteActions(AbstractAction):
The ID list of files to be attached
poll : MiPoll | None, default=None
"""
body = create_note_body(
text=text,
visibility=visibility,
@ -830,7 +829,6 @@ class ClientNoteActions(SharedNoteActions):
list[Clip]
Clips of the note
"""
note_id = note_id or self._note_id
return await super().get_clips(note_id=note_id)
@ -970,7 +968,7 @@ class ClientNoteActions(SharedNoteActions):
Endpoint: `/api/notes/replies`
Parameters
---------
----------
since_id : str | None, default=None
since id
until_id : str | None, default=None
@ -1004,7 +1002,7 @@ class ClientNoteActions(SharedNoteActions):
Endpoint: `/api/notes/replies`
Parameters
---------
----------
since_id : str | None, default=None
since id
until_id : str | None, default=None
@ -1082,7 +1080,6 @@ class ClientNoteActions(SharedNoteActions):
bool
success or not
"""
note_id = note_id or self._note_id
return await super().add_clips(clip_id=clip_id, note_id=note_id)
@ -1103,7 +1100,6 @@ class ClientNoteActions(SharedNoteActions):
Note
Renoted note
"""
note_id = note_id or self._note_id
return await super().create_renote(note_id=note_id)
@ -1254,7 +1250,6 @@ class ClientNoteActions(SharedNoteActions):
note_id: str | None, default=None
Note IDs to target for renote and citations
"""
note_id = note_id or self._note_id
return await super().create_quote(
@ -1969,7 +1964,9 @@ class NoteActions(SharedNoteActions):
Returns
-------
list[Note]
Notes
Notes
-----
"""
data = {
"limit": limit,

@ -127,7 +127,6 @@ class ClientReactionActions(SharedReactionActions):
bool
success or not
"""
note_id = note_id or self.__note_id
return await super().add(reaction=reaction, note_id=note_id)

@ -86,7 +86,6 @@ class RoleActions(AbstractAction):
AsyncGenerator[RoleUser, None]
The role user data.
"""
if limit > 100:
raise ValueError("Limit cannot be greater than 100")
@ -143,7 +142,6 @@ class RoleActions(AbstractAction):
AsyncGenerator[Note, None]
The note data.
"""
if limit > 100:
raise ValueError("Limit cannot be greater than 100")

@ -888,10 +888,7 @@ class UserActions(SharedUserActions):
super().__init__(session=session, client=client)
async def get_me(self) -> MeDetailed:
"""
ログインしているユーザーの情報を取得します
"""
"""ログインしているユーザーの情報を取得します"""
res: IMeDetailedSchema = await self._session.request(
Route("POST", "/api/i"),
lower=True,
@ -923,7 +920,6 @@ class UserActions(SharedUserActions):
host : str, default=None
Hosts with target users
"""
field = remove_dict_empty(
{"userId": user_id, "username": username, "host": host, "userIds": user_ids}
)
@ -1005,7 +1001,6 @@ class UserActions(SharedUserActions):
list[UserDetailedNotMe | MeDetailed | PartialUser]
A list of users.
"""
if limit > 100:
raise ValueError("limit は100以下である必要があります")
@ -1080,7 +1075,6 @@ class UserActions(SharedUserActions):
Whether to return all users.
"""
if limit > 100:
raise ValueError("limit は100以下である必要があります")

@ -116,7 +116,6 @@ class MuteActions(SharedMuteActions):
list[Muting]
ミュートしているユーザーの一覧
"""
body = {"limit": limit, "sinceId": since_id, "untilId": until_id}
mutes: list[IMuting] = await self._session.request(

@ -47,7 +47,6 @@ class DriveStatus:
def _get(self, key: str) -> Any | None:
"""You can access the raw response data directly by specifying the key
Returns
-------
Any | None
@ -79,7 +78,6 @@ class FileProperties:
def _get(self, key: str) -> Any | None:
"""You can access the raw response data directly by specifying the key
Returns
-------
Any | None
@ -128,7 +126,6 @@ class Folder:
def _get(self, key: str) -> Any | None:
"""You can access the raw response data directly by specifying the key
Returns
-------
Any | None
@ -227,7 +224,6 @@ class File:
def _get(self, key: str) -> Any | None:
"""You can access the raw response data directly by specifying the key
Returns
-------
Any | None

@ -48,7 +48,6 @@ class PartialAd[T: IPartialAd]:
def _get(self, key: str) -> Any | None:
"""You can access the raw response data directly by specifying the key
Returns
-------
Any | None

@ -81,7 +81,7 @@ class NoteReaction:
@property
def id(self) -> str | None:
"""note reactionId
"""Note reactionId
Returns
-------
@ -92,7 +92,7 @@ class NoteReaction:
@property
def created_at(self) -> datetime | None:
"""note createdAt
"""Note createdAt
Returns
-------
@ -107,7 +107,7 @@ class NoteReaction:
@property
def user(self) -> PartialUser:
"""note user
"""Note user
Returns
-------
@ -118,7 +118,7 @@ class NoteReaction:
@property
def type(self) -> str | None:
"""reaction type
"""Reaction type
Returns
-------
@ -144,7 +144,7 @@ class NoteChannel:
@property
def id(self) -> str:
"""note channelId
"""Note channelId
Returns
-------
@ -155,7 +155,7 @@ class NoteChannel:
@property
def name(self) -> str:
"""note channelName
"""Note channelName
Returns
-------
@ -166,7 +166,7 @@ class NoteChannel:
@property
def color(self) -> str:
"""note channelColor
"""Note channelColor
Returns
-------
@ -177,7 +177,7 @@ class NoteChannel:
@property
def is_sensitive(self) -> bool:
"""note channelIsSensitive
"""Note channelIsSensitive
Returns
-------
@ -188,7 +188,7 @@ class NoteChannel:
@property
def allow_renote_to_external(self) -> bool:
"""note channelAllowRenoteToExternal
"""Note channelAllowRenoteToExternal
Returns
-------
@ -199,7 +199,7 @@ class NoteChannel:
@property
def user_id(self) -> str | None:
"""note channelUserId
"""Note channelUserId
Returns
-------
@ -241,7 +241,7 @@ class Note:
@property
def created_at(self) -> datetime:
"""note createdAt
"""Note createdAt
Returns
-------
@ -252,7 +252,7 @@ class Note:
@property
def deleted_at(self) -> datetime | None:
"""note deletedAt
"""Note deletedAt
Returns
-------
@ -267,7 +267,7 @@ class Note:
@property
def text(self) -> str | None:
"""note text
"""Note text
Returns
-------
@ -279,7 +279,7 @@ class Note:
@property
@deprecated
def content(self) -> str | None:
"""note content
"""Note content
.. deprecated:: 0.6.0
Use :meth:`mipac.models.note.Note.text` instead.
@ -293,7 +293,7 @@ class Note:
@property
def cw(self) -> str | None:
"""note cw
"""Note cw
Returns
-------
@ -304,7 +304,7 @@ class Note:
@property
def user_id(self) -> str:
"""note userId
"""Note userId
Returns
-------
@ -316,7 +316,7 @@ class Note:
@property
@deprecated
def author(self) -> PartialUser:
"""note author
"""Note author
.. deprecated:: 0.6.0
Use :meth:`mipac.models.note.Note.user` instead.
@ -331,7 +331,7 @@ class Note:
@property
def user(self) -> PartialUser:
"""note author
"""Note author
Returns
-------
@ -342,7 +342,7 @@ class Note:
@property
def reply_id(self) -> str | None:
"""note replyId
"""Note replyId
Returns
-------
@ -353,7 +353,7 @@ class Note:
@property
def renote_id(self) -> str | None:
"""note renoteId
"""Note renoteId
Returns
-------
@ -364,7 +364,7 @@ class Note:
@property
def reply(self) -> Note | None:
"""note reply
"""Note reply
Returns
-------
@ -379,7 +379,7 @@ class Note:
@property
def renote(self) -> Note | None:
"""note renote
"""Note renote
Returns
-------
@ -394,7 +394,7 @@ class Note:
@property
def is_hidden(self) -> bool | None:
"""note isHidden
"""Note isHidden
Returns
-------
@ -405,7 +405,7 @@ class Note:
@property
def visibility(self) -> INoteVisibility:
"""note visibility
"""Note visibility
Returns
-------
@ -416,7 +416,7 @@ class Note:
@property
def mentions(self) -> list[str]:
"""note mentions
"""Note mentions
Returns
-------
@ -427,7 +427,7 @@ class Note:
@property
def visible_user_ids(self) -> list[str]:
"""note visibleUserIds
"""Note visibleUserIds
Returns
-------
@ -438,7 +438,7 @@ class Note:
@property
def file_ids(self) -> list[str]:
"""note fileIds
"""Note fileIds
Returns
-------
@ -449,7 +449,7 @@ class Note:
@property
def files(self) -> list[File]:
"""note files
"""Note files
Returns
-------
@ -460,7 +460,7 @@ class Note:
@property
def tags(self) -> list[str]:
"""note tags
"""Note tags
Returns
-------
@ -471,7 +471,7 @@ class Note:
@property
def poll(self) -> Poll | None:
"""note poll
"""Note poll
Returns
-------
@ -486,7 +486,7 @@ class Note:
@property
def emojis(self) -> dict[str, str]:
"""note emojis
"""Note emojis
Returns
-------
@ -497,7 +497,7 @@ class Note:
@property
def channel_id(self) -> str | None:
"""note channelId
"""Note channelId
Returns
-------
@ -508,7 +508,7 @@ class Note:
@property
def channel(self) -> NoteChannel | None:
"""note channel
"""Note channel
Returns
-------
@ -523,7 +523,7 @@ class Note:
@property
def local_only(self) -> bool:
"""note localOnly
"""Note localOnly
Returns
-------
@ -534,7 +534,7 @@ class Note:
@property
def reaction_acceptance(self) -> IReactionAcceptance:
"""note reactionAcceptance
"""Note reactionAcceptance
Returns
-------
@ -545,7 +545,7 @@ class Note:
@property
def reactions(self) -> dict[str, int]:
"""note reactions
"""Note reactions
Returns
-------
@ -556,7 +556,7 @@ class Note:
@property
def renote_count(self) -> int:
"""note renoteCount
"""Note renoteCount
Returns
-------
@ -567,7 +567,7 @@ class Note:
@property
def replies_count(self) -> int:
"""note repliesCount
"""Note repliesCount
Returns
-------
@ -578,7 +578,7 @@ class Note:
@property
def uri(self) -> str | None:
"""note uri
"""Note uri
Returns
-------
@ -589,7 +589,7 @@ class Note:
@property
def url(self) -> str | None:
"""note url
"""Note url
Returns
-------
@ -600,7 +600,7 @@ class Note:
@property
def reaction_and_user_pair_cache(self) -> dict[str, list[PartialUser]]:
"""note reactionAndUserPairCache
"""Note reactionAndUserPairCache
Returns
-------
@ -619,7 +619,7 @@ class Note:
@property
def clipped_count(self) -> int | None:
"""note clippedCount
"""Note clippedCount
Returns
-------
@ -630,7 +630,7 @@ class Note:
@property
def my_reaction(self) -> str | None:
"""note myReaction
"""Note myReaction
Returns
-------
@ -641,7 +641,7 @@ class Note:
@property
def api(self) -> ClientNoteManager:
"""note api
"""Note api
Returns
-------

@ -17,9 +17,7 @@ class IDriveStatus(TypedDict):
class IFileProperties(TypedDict):
"""
プロパティー情報
"""
"""プロパティー情報"""
width: NotRequired[int]
height: NotRequired[int]
@ -28,9 +26,7 @@ class IFileProperties(TypedDict):
class IFolder(TypedDict):
"""
フォルダーの情報
"""
"""フォルダーの情報"""
id: str
created_at: str
@ -42,9 +38,7 @@ class IFolder(TypedDict):
class IFile(TypedDict):
"""
ファイル情報
"""
"""ファイル情報"""
id: str
created_at: str

@ -99,9 +99,7 @@ class INote(TypedDict):
class ICreatedNote(TypedDict):
"""
created note
"""
"""created note"""
created_note: INote

@ -10,9 +10,7 @@ class IPollChoice(TypedDict):
class IPoll(TypedDict):
"""
Questionnaire object
"""
"""Questionnaire object"""
expires_at: str
multiple: bool

@ -111,9 +111,7 @@ class IUserSecurityKey(TypedDict):
class IPartialUser(TypedDict):
"""
Misskey Schema: `packedUserLiteSchema`
"""
"""Misskey Schema: `packedUserLiteSchema`"""
id: str
name: str | None
@ -131,9 +129,7 @@ class IPartialUser(TypedDict):
class IUserDetailedNotMeOnlySchema(TypedDict):
"""
Misskey Schema: `packedUserDetailedNotMeOnlySchema`
"""
"""Misskey Schema: `packedUserDetailedNotMeOnlySchema`"""
url: str | None
uri: str | None

@ -163,6 +163,7 @@ def bool_to_string(boolean: bool) -> str:
----------
boolean : bool
変更したいbool値
Returns
-------
true or false: str

Loading…
Cancel
Save