From eeda5dfd67af5402371b1702f4610be819966e66 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 2 Jan 2021 16:44:18 -0800 Subject: [PATCH] Fix exception doc strings --- plexapi/library.py | 4 ++-- plexapi/myplex.py | 8 ++++---- plexapi/playlist.py | 4 ++-- plexapi/server.py | 4 ++-- plexapi/sync.py | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plexapi/library.py b/plexapi/library.py index 9e86d9bb..f6c515df 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -658,7 +658,7 @@ class LibrarySection(PlexObject): * year: List of years to search within ([yyyy, ...]). [all] Raises: - :exc:`~plexapi.exceptions.BadRequest`: when applying unknown filter + :exc:`~plexapi.exceptions.BadRequest`: When applying an unknown filter. """ # cleanup the core arguments args = {} @@ -779,7 +779,7 @@ class LibrarySection(PlexObject): :class:`~plexapi.sync.SyncItem`: an instance of created syncItem. Raises: - :exc:`~plexapi.exceptions.BadRequest`: when the library is not allowed to sync + :exc:`~plexapi.exceptions.BadRequest`: When the library is not allowed to sync. Example: diff --git a/plexapi/myplex.py b/plexapi/myplex.py index 198d1f02..cb195f4a 100644 --- a/plexapi/myplex.py +++ b/plexapi/myplex.py @@ -580,8 +580,8 @@ class MyPlexAccount(PlexObject): :class:`~plexapi.sync.SyncItem`: an instance of created syncItem. Raises: - :exc:`~plexapi.exceptions.BadRequest`: when client with provided clientId wasn`t found. - :exc:`~plexapi.exceptions.BadRequest`: provided client doesn`t provides `sync-target`. + :exc:`~plexapi.exceptions.BadRequest`: When client with provided clientId wasn`t found. + :exc:`~plexapi.exceptions.BadRequest`: Provided client doesn`t provides `sync-target`. """ if not client and not clientId: clientId = X_PLEX_IDENTIFIER @@ -1155,8 +1155,8 @@ class MyPlexPinLogin(object): timeout (int): Timeout in seconds waiting for the PIN login to succeed (optional). Raises: - :class:`RuntimeError`: if the thread is already running. - :class:`RuntimeError`: if the PIN login for the current PIN has expired. + :class:`RuntimeError`: If the thread is already running. + :class:`RuntimeError`: If the PIN login for the current PIN has expired. """ if self._thread and not self._abort: raise RuntimeError('MyPlexPinLogin thread is already running') diff --git a/plexapi/playlist.py b/plexapi/playlist.py index 847a56fc..48d5dde7 100644 --- a/plexapi/playlist.py +++ b/plexapi/playlist.py @@ -272,8 +272,8 @@ class Playlist(PlexPartialObject, Playable): generated from metadata of current photo. Raises: - :exc:`~plexapi.exceptions.BadRequest`: when playlist is not allowed to sync. - :exc:`~plexapi.exceptions.Unsupported`: when playlist content is unsupported. + :exc:`~plexapi.exceptions.BadRequest`: When playlist is not allowed to sync. + :exc:`~plexapi.exceptions.Unsupported`: When playlist content is unsupported. Returns: :class:`~plexapi.sync.SyncItem`: an instance of created syncItem. diff --git a/plexapi/server.py b/plexapi/server.py index d005ea71..ab59511e 100644 --- a/plexapi/server.py +++ b/plexapi/server.py @@ -317,7 +317,7 @@ class PlexServer(PlexObject): name (str): Name of the client to return. Raises: - :exc:`~plexapi.exceptions.NotFound`: Unknown client name + :exc:`~plexapi.exceptions.NotFound`: Unknown client name. """ for client in self.clients(): if client and client.title == name: @@ -440,7 +440,7 @@ class PlexServer(PlexObject): title (str): Title of the playlist to return. Raises: - :exc:`~plexapi.exceptions.NotFound`: Invalid playlist title + :exc:`~plexapi.exceptions.NotFound`: Invalid playlist title. """ return self.fetchItem('/playlists', title=title) diff --git a/plexapi/sync.py b/plexapi/sync.py index 638ea0ac..ce60ca9f 100644 --- a/plexapi/sync.py +++ b/plexapi/sync.py @@ -201,7 +201,7 @@ class MediaSettings(object): videoQuality (int): idx of quality of the video, one of VIDEO_QUALITY_* values defined in this module. Raises: - :exc:`~plexapi.exceptions.BadRequest`: when provided unknown video quality. + :exc:`~plexapi.exceptions.BadRequest`: When provided unknown video quality. """ if videoQuality == VIDEO_QUALITY_ORIGINAL: return MediaSettings('', '', '') @@ -231,7 +231,7 @@ class MediaSettings(object): module. Raises: - :exc:`~plexapi.exceptions.BadRequest` when provided unknown video quality. + :exc:`~plexapi.exceptions.BadRequest`: When provided unknown video quality. """ if resolution in PHOTO_QUALITIES: return MediaSettings(photoQuality=PHOTO_QUALITIES[resolution], photoResolution=resolution)