| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | |
| 6 import os | 5 import os |
| 7 from third_party.json_schema_compiler.model import UnixName | 6 from third_party.json_schema_compiler.model import UnixName |
| 8 import svn_constants | 7 import svn_constants |
| 9 | 8 |
| 10 class PathCanonicalizer(object): | 9 class PathCanonicalizer(object): |
| 11 '''Transforms paths into their canonical forms. Since the dev server has had | 10 '''Transforms paths into their canonical forms. Since the dev server has had |
| 12 many incarnations - e.g. there didn't use to be apps/ - there may be old | 11 many incarnations - e.g. there didn't use to be apps/ - there may be old |
| 13 paths lying around the webs. We try to redirect those to where they are now. | 12 paths lying around the webs. We try to redirect those to where they are now. |
| 14 ''' | 13 ''' |
| 15 def __init__(self, channel, compiled_fs_factory): | 14 def __init__(self, channel, compiled_fs_factory): |
| (...skipping 25 matching lines...) Expand all Loading... |
| 41 apps_path = '%s/apps/%s' % (self._channel, path_without_channel) | 40 apps_path = '%s/apps/%s' % (self._channel, path_without_channel) |
| 42 extensions_path = '%s/extensions/%s' % (self._channel, | 41 extensions_path = '%s/extensions/%s' % (self._channel, |
| 43 path_without_channel) | 42 path_without_channel) |
| 44 | 43 |
| 45 unix_path = UnixName(os.path.splitext(path_without_channel)[0]) | 44 unix_path = UnixName(os.path.splitext(path_without_channel)[0]) |
| 46 if unix_path in extensions_templates: | 45 if unix_path in extensions_templates: |
| 47 return extensions_path | 46 return extensions_path |
| 48 if unix_path in apps_templates: | 47 if unix_path in apps_templates: |
| 49 return apps_path | 48 return apps_path |
| 50 return extensions_path | 49 return extensions_path |
| OLD | NEW |