diff --git a/mopidy/backends/base.py b/mopidy/backends/base.py index 7450c982..6b980f06 100644 --- a/mopidy/backends/base.py +++ b/mopidy/backends/base.py @@ -2,8 +2,6 @@ from __future__ import unicode_literals import copy -from mopidy.utils import command - class Backend(object): #: Actor proxy to an instance of :class:`mopidy.audio.Audio`. @@ -281,42 +279,3 @@ class BasePlaylistsProvider(object): *MUST be implemented by subclass.* """ raise NotImplementedError - - -# Re-exporting from this location for backends. -class Command(command.Command): - pass - - -# TODO: remove -class BaseSubCommandProvider(object): - """Sub-classes may optionally add arguments to the passed in parser. - - :param parser: parser you may add arguments to - :type parser: :class:`argparse.ArgumentParser` - """ - - name = None - """What the sub-command should be called. Will be run as ``mopidy NAME``. - - Will be converted to :type:`bytes` and should be limited to ASCII - characters. Example: ``scan`` - """ - - help = None - """Optional help text for the sub-command, will be displayed in help.""" - - def __init__(self, parser): - pass - - def run(self, args, config, extensions): - """Run the sub-command implemented by this provider. - - *MUST be implemented by subclass.* - - :param args: the argments object from argparse - :param config: read-only version of the mopidy config - :param extensions: list of enabled extensions - :returns: integer exit value for the process - """ - raise NotImplementedError diff --git a/mopidy/backends/local/command.py b/mopidy/backends/local/command.py index db1a392f..c8a57863 100644 --- a/mopidy/backends/local/command.py +++ b/mopidy/backends/local/command.py @@ -6,21 +6,20 @@ import time from mopidy import exceptions from mopidy.audio import scan -from mopidy.backends import base -from mopidy.utils import path +from mopidy.utils import command, path from . import translator logger = logging.getLogger('mopidy.backends.local.scan') -class LocalCommand(base.Command): +class LocalCommand(command.Command): def __init__(self): super(LocalCommand, self).__init__() self.add_child('scan', ScanCommand()) -class ScanCommand(base.Command): +class ScanCommand(command.Command): """Scan local media files""" def run(self, args, config, extensions): diff --git a/mopidy/ext.py b/mopidy/ext.py index d9f376ff..118b49ec 100644 --- a/mopidy/ext.py +++ b/mopidy/ext.py @@ -87,15 +87,12 @@ class Extension(object): """ return [] - def get_sub_commads(self): - # TODO: remove - return [] - def get_command(self): """Command to expose to command line users running mopidy. :returns: - :class:`~mopidy.backends.base.Command` instance + Instance of a :class:`~mopidy.utils.command.Command` class + or sub-class. """ pass