docs: Make extensiondev example and API docs for validate_environment() match

(cherry picked from commit 31c874b3eb)
This commit is contained in:
Stein Magnus Jodal 2014-10-12 11:40:59 +02:00
parent fe63e425d5
commit c9b0101e76
2 changed files with 8 additions and 7 deletions

View File

@ -317,7 +317,7 @@ This is ``mopidy_soundspot/__init__.py``::
gobject.type_register(SoundspotMixer) gobject.type_register(SoundspotMixer)
gst.element_register( gst.element_register(
SoundspotMixer, 'soundspotmixer', gst.RANK_MARGINAL) SoundspotMixer, 'soundspotmixer', gst.RANK_MARGINAL)
# Or nothing to register e.g. command extension # Or nothing to register e.g. command extension
pass pass

View File

@ -52,7 +52,7 @@ class Extension(object):
return schema return schema
def get_command(self): def get_command(self):
"""Command to expose to command line users running mopidy. """Command to expose to command line users running ``mopidy``.
:returns: :returns:
Instance of a :class:`~mopidy.commands.Command` class. Instance of a :class:`~mopidy.commands.Command` class.
@ -60,12 +60,13 @@ class Extension(object):
pass pass
def validate_environment(self): def validate_environment(self):
"""Checks if the extension can run in the current environment """Checks if the extension can run in the current environment.
For example, this method can be used to check if all dependencies that Dependencies described by :file:`setup.py` are checked by Mopidy, so
are needed are installed. If a problem is found, raise you should not check their presence here.
:exc:`~mopidy.exceptions.ExtensionError` with a message explaining the
issue. If a problem is found, raise :exc:`~mopidy.exceptions.ExtensionError`
with a message explaining the issue.
:raises: :exc:`~mopidy.exceptions.ExtensionError` :raises: :exc:`~mopidy.exceptions.ExtensionError`
:returns: :class:`None` :returns: :class:`None`