From cad0207ef8c1949b6bdb893186f0e5263ad02254 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 20 May 2014 22:12:06 +0200 Subject: [PATCH] http: Rename 'path' to 'static_file_path' --- mopidy/http/__init__.py | 10 +++++----- tests/http/test_router.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mopidy/http/__init__.py b/mopidy/http/__init__.py index b8d7d533..e7a2ec1c 100644 --- a/mopidy/http/__init__.py +++ b/mopidy/http/__init__.py @@ -63,8 +63,8 @@ class Router(object): #: Name of the HTTP router implementation, must be overridden. name = None - #: Path to location of static files. - path = None + #: Path to location of static files to be served. + static_file_path = None def __init__(self, config): self.config = config @@ -91,13 +91,13 @@ class Router(object): :return: list of Tornado routes """ - if self.path is None: - raise ValueError('Undefined path in %s' % self) + if self.static_file_path is None: + raise ValueError('Undefined static file path in %s' % self) logger.info( 'Serving HTTP extension %s at %s', type(self), self.linkify()) return [ (r'/%s/(.*)' % self.name, StaticFileHandler, { - 'path': self.path, + 'path': self.static_file_path, 'default_filename': 'index.html' }), ] diff --git a/tests/http/test_router.py b/tests/http/test_router.py index 9c73cf15..370a140b 100644 --- a/tests/http/test_router.py +++ b/tests/http/test_router.py @@ -23,7 +23,7 @@ if tornado: class TestRouter(http.Router): name = 'test' - path = os.path.join(os.path.dirname(__file__), 'static') + static_file_path = os.path.join(os.path.dirname(__file__), 'static') class TestRouterMissingPath(http.Router): @@ -31,7 +31,7 @@ class TestRouterMissingPath(http.Router): class TestRouterMissingName(http.Router): - path = os.path.join(os.path.dirname(__file__), 'static') + static_file_path = os.path.join(os.path.dirname(__file__), 'static') @unittest.skipUnless(tornado, 'tornado is missing')