http: Rename 'path' to 'static_file_path'

This commit is contained in:
Stein Magnus Jodal 2014-05-20 22:12:06 +02:00
parent 4d7ab27836
commit cad0207ef8
2 changed files with 7 additions and 7 deletions

View File

@ -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'
}),
]

View File

@ -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')