mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 06:04:15 +00:00
Fix doc building
This commit is contained in:
parent
ae59620e9a
commit
b451b22bb8
11 changed files with 25 additions and 32 deletions
|
@ -24,7 +24,7 @@ import plexapi
|
|||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.napoleon',
|
||||
'sphinx.ext.napoleon',
|
||||
]
|
||||
|
||||
# -- Monkey-patch docstring to not auto-link :ivars ------------------------
|
||||
|
|
|
@ -688,7 +688,7 @@ class Playable(object):
|
|||
offset, copyts, protocol, mediaIndex, platform.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.Unsupported`: When the item doesn't support fetching a stream URL.
|
||||
:exc:`~plexapi.exceptions.Unsupported`: When the item doesn't support fetching a stream URL.
|
||||
"""
|
||||
if self.TYPE not in ('movie', 'episode', 'track'):
|
||||
raise Unsupported('Fetching stream URL for %s is unsupported.' % self.TYPE)
|
||||
|
|
|
@ -140,7 +140,7 @@ class PlexClient(PlexObject):
|
|||
value (bool): Enable or disable proxying (optional, default True).
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.Unsupported`: Cannot use client proxy with unknown server.
|
||||
:exc:`~plexapi.exceptions.Unsupported`: Cannot use client proxy with unknown server.
|
||||
"""
|
||||
if server:
|
||||
self._server = server
|
||||
|
@ -183,7 +183,7 @@ class PlexClient(PlexObject):
|
|||
**params (dict): Additional GET parameters to include with the command.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.Unsupported`: When we detect the client doesn't support this capability.
|
||||
:exc:`~plexapi.exceptions.Unsupported`: When we detect the client doesn't support this capability.
|
||||
"""
|
||||
command = command.strip('/')
|
||||
controller = command.split('/')[0]
|
||||
|
@ -299,7 +299,7 @@ class PlexClient(PlexObject):
|
|||
**params (dict): Additional GET parameters to include with the command.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
|
||||
:exc:`~plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
|
||||
"""
|
||||
if not self._server:
|
||||
raise Unsupported('A server must be specified before using this command.')
|
||||
|
@ -469,7 +469,7 @@ class PlexClient(PlexObject):
|
|||
also: https://github.com/plexinc/plex-media-player/wiki/Remote-control-API#modified-commands
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
|
||||
:exc:`~plexapi.exceptions.Unsupported`: When no PlexServer specified in this object.
|
||||
"""
|
||||
if not self._server:
|
||||
raise Unsupported('A server must be specified before using this command.')
|
||||
|
|
|
@ -620,7 +620,7 @@ class LibrarySection(PlexObject):
|
|||
**kwargs (dict): Additional kwargs to narrow down the choices.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.BadRequest`: Cannot include kwarg equal to specified category.
|
||||
:exc:`~plexapi.exceptions.BadRequest`: Cannot include kwarg equal to specified category.
|
||||
"""
|
||||
# TODO: Should this be moved to base?
|
||||
if category in kwargs:
|
||||
|
@ -667,7 +667,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 unknown filter
|
||||
"""
|
||||
# cleanup the core arguments
|
||||
args = {}
|
||||
|
@ -786,7 +786,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:
|
||||
|
||||
|
|
|
@ -578,8 +578,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
|
||||
|
@ -942,7 +942,7 @@ class MyPlexResource(PlexObject):
|
|||
HTTP or HTTPS connection.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.NotFound`: When unable to connect to any addresses for this resource.
|
||||
:exc:`~plexapi.exceptions.NotFound`: When unable to connect to any addresses for this resource.
|
||||
"""
|
||||
# Sort connections from (https, local) to (http, remote)
|
||||
# Only check non-local connections unless we own the resource
|
||||
|
@ -1049,7 +1049,7 @@ class MyPlexDevice(PlexObject):
|
|||
at least one connection was successful, the PlexClient object is built and returned.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.NotFound`: When unable to connect to any addresses for this device.
|
||||
:exc:`~plexapi.exceptions.NotFound`: When unable to connect to any addresses for this device.
|
||||
"""
|
||||
cls = PlexServer if 'server' in self.provides else PlexClient
|
||||
listargs = [[cls, url, self.token, timeout] for url in self.connections]
|
||||
|
@ -1066,7 +1066,7 @@ class MyPlexDevice(PlexObject):
|
|||
""" Returns an instance of :class:`~plexapi.sync.SyncList` for current device.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.BadRequest`: when the device doesn`t provides `sync-target`.
|
||||
:exc:`~plexapi.exceptions.BadRequest`: when the device doesn`t provides `sync-target`.
|
||||
"""
|
||||
if 'sync-target' not in self.provides:
|
||||
raise BadRequest('Requested syncList for device which do not provides sync-target')
|
||||
|
|
|
@ -240,8 +240,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.
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
@ -542,7 +542,7 @@ class PlexServer(PlexObject):
|
|||
callback (func): Callback function to call on recieved messages.
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exception.Unsupported`: Websocket-client not installed.
|
||||
:exc:`~plexapi.exception.Unsupported`: Websocket-client not installed.
|
||||
"""
|
||||
notifier = AlertListener(self, callback)
|
||||
notifier.start()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -147,7 +147,7 @@ def searchType(libtype):
|
|||
libtype (str): LibType to lookup (movie, show, season, episode, artist, album, track,
|
||||
collection)
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.NotFound`: Unknown libtype
|
||||
:exc:`~plexapi.exceptions.NotFound`: Unknown libtype
|
||||
"""
|
||||
libtype = str(libtype)
|
||||
if libtype in [str(v) for v in SEARCHTYPES.values()]:
|
||||
|
|
|
@ -521,8 +521,8 @@ class Show(Video):
|
|||
episode (int): Episode number (default:None; required if title not specified).
|
||||
|
||||
Raises:
|
||||
:exc:`plexapi.exceptions.BadRequest`: If season and episode is missing.
|
||||
:exc:`plexapi.exceptions.NotFound`: If the episode is missing.
|
||||
:exc:`~plexapi.exceptions.BadRequest`: If season and episode is missing.
|
||||
:exc:`~plexapi.exceptions.NotFound`: If the episode is missing.
|
||||
"""
|
||||
if title:
|
||||
key = '/library/metadata/%s/allLeaves' % self.ratingKey
|
||||
|
|
|
@ -13,14 +13,7 @@ recommonmark
|
|||
requests
|
||||
requests-mock
|
||||
sphinx
|
||||
sphinxcontrib-napoleon
|
||||
sphinx-rtd-theme
|
||||
tqdm
|
||||
websocket-client
|
||||
mock; python_version < '3.3'
|
||||
|
||||
|
||||
# Installing sphinx-rtd-theme directly from github above is used until a point release
|
||||
# above 0.4.3 is released. https://github.com/readthedocs/sphinx_rtd_theme/issues/739
|
||||
#sphinx-rtd-theme
|
||||
-e git+https://github.com/readthedocs/sphinx_rtd_theme.git@feb0beb44a444f875f3369a945e6055965ee993f#egg=sphinx_rtd_theme
|
||||
|
||||
|
|
Loading…
Reference in a new issue