Skip to content

Commit

Permalink
internal: Move find_mtimes() to Mopidy-Local
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Dec 15, 2019
1 parent c935f1a commit d4c863d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 329 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Expand Up @@ -271,6 +271,9 @@ Local backend
`PyPI project <https://pypi.org/project/Mopidy-Local>`__.
(Fixes: :issue:`1003`)

- The :exception:`mopidy.exceptions.FindError` has been removed, as it was only
used by Mopidy-Local.

M3U backend
-----------

Expand Down
6 changes: 0 additions & 6 deletions mopidy/exceptions.py
Expand Up @@ -27,12 +27,6 @@ class ExtensionError(MopidyException):
pass


class FindError(MopidyException):
def __init__(self, message, errno=None):
super().__init__(message, errno)
self.errno = errno


class FrontendError(MopidyException):
pass

Expand Down
99 changes: 0 additions & 99 deletions mopidy/internal/mtimes.py

This file was deleted.

3 changes: 0 additions & 3 deletions mopidy/internal/path.py
Expand Up @@ -5,9 +5,6 @@

from mopidy.internal import xdg

# Reexport in old location for Mopidy-Local's use
from mopidy.internal.mtimes import find_mtimes # noqa

logger = logging.getLogger(__name__)


Expand Down
13 changes: 7 additions & 6 deletions tests/audio/test_scan.py
Expand Up @@ -2,7 +2,7 @@

from mopidy import exceptions
from mopidy.audio import scan
from mopidy.internal import path as path_lib
from mopidy.internal.path import path_to_uri

from tests import path_to_data_dir

Expand All @@ -13,15 +13,16 @@ def setUp(self): # noqa: N802
self.result = {}

def find(self, path):
media_dir = path_to_data_dir(path)
result, errors = path_lib.find_mtimes(str(media_dir))
for path in result:
yield media_dir / path
dir_path = path_to_data_dir(path)
if not dir_path.is_dir():
return
for file_path in dir_path.iterdir():
yield dir_path / file_path

def scan(self, paths):
scanner = scan.Scanner()
for path in paths:
uri = path_lib.path_to_uri(path)
uri = path_to_uri(path)
try:
self.result[path] = scanner.scan(uri)
except exceptions.ScannerError as error:
Expand Down
206 changes: 0 additions & 206 deletions tests/internal/test_mtimes.py

This file was deleted.

9 changes: 0 additions & 9 deletions tests/test_exceptions.py
Expand Up @@ -16,15 +16,6 @@ def test_backend_error_is_a_mopidy_exception(self):
def test_extension_error_is_a_mopidy_exception(self):
assert issubclass(exceptions.ExtensionError, exceptions.MopidyException)

def test_find_error_is_a_mopidy_exception(self):
assert issubclass(exceptions.FindError, exceptions.MopidyException)

def test_find_error_can_store_an_errno(self):
exc = exceptions.FindError("msg", errno=1234)

assert exc.message == "msg"
assert exc.errno == 1234

def test_frontend_error_is_a_mopidy_exception(self):
assert issubclass(exceptions.FrontendError, exceptions.MopidyException)

Expand Down

0 comments on commit d4c863d

Please sign in to comment.