| Index: chrome/common/extensions/docs/server2/redirector.py
|
| diff --git a/chrome/common/extensions/docs/server2/redirector.py b/chrome/common/extensions/docs/server2/redirector.py
|
| index 0a38efd91d8e08ab293bfab96a992c5eb6619313..c5e36353b6397996f5b8662480a409a913b401fc 100644
|
| --- a/chrome/common/extensions/docs/server2/redirector.py
|
| +++ b/chrome/common/extensions/docs/server2/redirector.py
|
| @@ -8,8 +8,7 @@ from urlparse import urlsplit
|
| from file_system import FileNotFoundError
|
|
|
| class Redirector(object):
|
| - def __init__(self, compiled_fs_factory, file_system, root_path):
|
| - self._root_path = root_path
|
| + def __init__(self, compiled_fs_factory, file_system):
|
| self._file_system = file_system
|
| self._cache = compiled_fs_factory.ForJson(file_system)
|
|
|
| @@ -31,7 +30,7 @@ class Redirector(object):
|
|
|
| try:
|
| rules = self._cache.GetFromFile(
|
| - posixpath.join(self._root_path, dirname, 'redirects.json')).Get()
|
| + posixpath.join(dirname, 'redirects.json')).Get()
|
| except FileNotFoundError:
|
| return None
|
|
|
| @@ -42,7 +41,7 @@ class Redirector(object):
|
| urlsplit(redirect).scheme in ('http', 'https')):
|
| return redirect
|
|
|
| - return posixpath.normpath('/' + posixpath.join(dirname, redirect))
|
| + return posixpath.normpath(posixpath.join('/', dirname, redirect))
|
|
|
| def _RedirectOldHosts(self, host, path):
|
| ''' Redirect paths from the old code.google.com to the new
|
| @@ -61,7 +60,6 @@ class Redirector(object):
|
| def Cron(self):
|
| ''' Load files during a cron run.
|
| '''
|
| - for root, dirs, files in self._file_system.Walk(self._root_path):
|
| + for root, dirs, files in self._file_system.Walk(''):
|
| if 'redirects.json' in files:
|
| - self._cache.GetFromFile('%s/redirects.json' % posixpath.join(
|
| - self._root_path, root).rstrip('/')).Get()
|
| + self._cache.GetFromFile(posixpath.join(root, 'redirects.json')).Get()
|
|
|