Skip to content

Commit ba0821f

Browse files
authored
Merge pull request #307 from andrey-yantsen/fix-docs-in-new-sphinx
fix docs for Raises clauses
2 parents 58b1ab7 + 7a67417 commit ba0821f

File tree

8 files changed

+18
-19
lines changed

8 files changed

+18
-19
lines changed

plexapi/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def getStreamURL(self, **params):
471471
offset, copyts, protocol, mediaIndex, platform.
472472
473473
Raises:
474-
Unsupported: When the item doesn't support fetching a stream URL.
474+
:class:`plexapi.exceptions.Unsupported`: When the item doesn't support fetching a stream URL.
475475
"""
476476
if self.TYPE not in ('movie', 'episode', 'track'):
477477
raise Unsupported('Fetching stream URL for %s is unsupported.' % self.TYPE)

plexapi/client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def proxyThroughServer(self, value=True, server=None):
139139
value (bool): Enable or disable proxying (optional, default True).
140140
141141
Raises:
142-
:class:`~plexapi.exceptions.Unsupported`: Cannot use client proxy with unknown server.
142+
:class:`plexapi.exceptions.Unsupported`: Cannot use client proxy with unknown server.
143143
"""
144144
if server:
145145
self._server = server
@@ -177,8 +177,7 @@ def sendCommand(self, command, proxy=None, **params):
177177
**params (dict): Additional GET parameters to include with the command.
178178
179179
Raises:
180-
:class:`~plexapi.exceptions.Unsupported`: When we detect the client
181-
doesn't support this capability.
180+
:class:`plexapi.exceptions.Unsupported`: When we detect the client doesn't support this capability.
182181
"""
183182
command = command.strip('/')
184183
controller = command.split('/')[0]
@@ -272,7 +271,7 @@ def goToMedia(self, media, **params):
272271
**params (dict): Additional GET parameters to include with the command.
273272
274273
Raises:
275-
:class:`~plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
274+
:class:`plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
276275
"""
277276
if not self._server:
278277
raise Unsupported('A server must be specified before using this command.')
@@ -440,7 +439,7 @@ def playMedia(self, media, offset=0, **params):
440439
also: https://github.com/plexinc/plex-media-player/wiki/Remote-control-API#modified-commands
441440
442441
Raises:
443-
:class:`~plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
442+
:class:`plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
444443
"""
445444
if not self._server:
446445
raise Unsupported('A server must be specified before using this command.')

plexapi/library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def listChoices(self, category, libtype=None, **kwargs):
443443
**kwargs (dict): Additional kwargs to narrow down the choices.
444444
445445
Raises:
446-
:class:`~plexapi.exceptions.BadRequest`: Cannot include kwarg equal to specified category.
446+
:class:`plexapi.exceptions.BadRequest`: Cannot include kwarg equal to specified category.
447447
"""
448448
# TODO: Should this be moved to base?
449449
if category in kwargs:

plexapi/myplex.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ def sync(self, sync_item, client=None, clientId=None):
433433
:class:`plexapi.sync.SyncItem`: an instance of created syncItem.
434434
435435
Raises:
436-
:class:`plexapi.exceptions.BadRequest` when client with provided clientId wasn`t found.
437-
:class:`plexapi.exceptions.BadRequest` provided client doesn`t provides `sync-target`.
436+
:class:`plexapi.exceptions.BadRequest`: when client with provided clientId wasn`t found.
437+
:class:`plexapi.exceptions.BadRequest`: provided client doesn`t provides `sync-target`.
438438
"""
439439
if not client and not clientId:
440440
clientId = X_PLEX_IDENTIFIER
@@ -690,7 +690,7 @@ def connect(self, ssl=None, timeout=None):
690690
HTTP or HTTPS connection.
691691
692692
Raises:
693-
:class:`~plexapi.exceptions.NotFound`: When unable to connect to any addresses for this resource.
693+
:class:`plexapi.exceptions.NotFound`: When unable to connect to any addresses for this resource.
694694
"""
695695
# Sort connections from (https, local) to (http, remote)
696696
# Only check non-local connections unless we own the resource
@@ -797,7 +797,7 @@ def connect(self, timeout=None):
797797
at least one connection was successful, the PlexClient object is built and returned.
798798
799799
Raises:
800-
:class:`~plexapi.exceptions.NotFound`: When unable to connect to any addresses for this device.
800+
:class:`plexapi.exceptions.NotFound`: When unable to connect to any addresses for this device.
801801
"""
802802
cls = PlexServer if 'server' in self.provides else PlexClient
803803
listargs = [[cls, url, self.token, timeout] for url in self.connections]
@@ -814,7 +814,7 @@ def syncItems(self):
814814
""" Returns an instance of :class:`plexapi.sync.SyncList` for current device.
815815
816816
Raises:
817-
:class:`plexapi.exceptions.BadRequest` when the device doesn`t provides `sync-target`.
817+
:class:`plexapi.exceptions.BadRequest`: when the device doesn`t provides `sync-target`.
818818
"""
819819
if 'sync-target' not in self.provides:
820820
raise BadRequest('Requested syncList for device which do not provides sync-target')

plexapi/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def client(self, name):
232232
name (str): Name of the client to return.
233233
234234
Raises:
235-
:class:`~plexapi.exceptions.NotFound`: Unknown client name
235+
:class:`plexapi.exceptions.NotFound`: Unknown client name
236236
"""
237237
for client in self.clients():
238238
if client and client.title == name:
@@ -326,7 +326,7 @@ def playlist(self, title):
326326
title (str): Title of the playlist to return.
327327
328328
Raises:
329-
:class:`~plexapi.exceptions.NotFound`: Invalid playlist title
329+
:class:`plexapi.exceptions.NotFound`: Invalid playlist title
330330
"""
331331
return self.fetchItem('/playlists', title=title)
332332

@@ -393,7 +393,7 @@ def startAlertListener(self, callback=None):
393393
callback (func): Callback function to call on recieved messages.
394394
395395
raises:
396-
:class:`~plexapi.exception.Unsupported`: Websocket-client not installed.
396+
:class:`plexapi.exception.Unsupported`: Websocket-client not installed.
397397
"""
398398
notifier = AlertListener(self, callback)
399399
notifier.start()

plexapi/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def createVideo(videoQuality):
201201
videoQuality (int): idx of quality of the video, one of VIDEO_QUALITY_* values defined in this module.
202202
203203
Raises:
204-
:class:`plexapi.exceptions.BadRequest` when provided unknown video quality.
204+
:class:`plexapi.exceptions.BadRequest`: when provided unknown video quality.
205205
"""
206206
if videoQuality == VIDEO_QUALITY_ORIGINAL:
207207
return MediaSettings('', '', '')

plexapi/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def searchType(libtype):
133133
libtype (str): LibType to lookup (movie, show, season, episode, artist, album, track,
134134
collection)
135135
Raises:
136-
NotFound: Unknown libtype
136+
:class:`plexapi.exceptions.NotFound`: Unknown libtype
137137
"""
138138
libtype = compat.ustr(libtype)
139139
if libtype in [compat.ustr(v) for v in SEARCHTYPES.values()]:

plexapi/video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ def episode(self, title=None, season=None, episode=None):
351351
episode (int): Episode number (default:None; required if title not specified).
352352
353353
Raises:
354-
BadRequest: If season and episode is missing.
355-
NotFound: If the episode is missing.
354+
:class:`plexapi.exceptions.BadRequest`: If season and episode is missing.
355+
:class:`plexapi.exceptions.NotFound`: If the episode is missing.
356356
"""
357357
if title:
358358
key = '/library/metadata/%s/allLeaves' % self.ratingKey

0 commit comments

Comments
 (0)