| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 | 5 import logging |
| 6 import os | 6 import os |
| 7 from StringIO import StringIO | 7 from StringIO import StringIO |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from appengine_wrappers import webapp | 10 from appengine_wrappers import webapp |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 cache_factory = CompiledFileSystem.Factory(file_system, branch_memcache) | 87 cache_factory = CompiledFileSystem.Factory(file_system, branch_memcache) |
| 88 api_list_data_source_factory = APIListDataSource.Factory(cache_factory, | 88 api_list_data_source_factory = APIListDataSource.Factory(cache_factory, |
| 89 file_system, | 89 file_system, |
| 90 API_PATH, | 90 API_PATH, |
| 91 PUBLIC_TEMPLATE_PATH) | 91 PUBLIC_TEMPLATE_PATH) |
| 92 intro_data_source_factory = IntroDataSource.Factory( | 92 intro_data_source_factory = IntroDataSource.Factory( |
| 93 cache_factory, | 93 cache_factory, |
| 94 [INTRO_PATH, ARTICLE_PATH]) | 94 [INTRO_PATH, ARTICLE_PATH]) |
| 95 samples_data_source_factory = SamplesDataSource.Factory( | 95 samples_data_source_factory = SamplesDataSource.Factory( |
| 96 branch, | 96 channel_name, |
| 97 file_system, | 97 file_system, |
| 98 GITHUB_FILE_SYSTEM, | 98 GITHUB_FILE_SYSTEM, |
| 99 cache_factory, | 99 cache_factory, |
| 100 GITHUB_COMPILED_FILE_SYSTEM, | 100 GITHUB_COMPILED_FILE_SYSTEM, |
| 101 EXAMPLES_PATH) | 101 EXAMPLES_PATH) |
| 102 api_data_source_factory = APIDataSource.Factory(cache_factory, | 102 api_data_source_factory = APIDataSource.Factory(cache_factory, |
| 103 API_PATH, | 103 API_PATH, |
| 104 samples_data_source_factory) | 104 samples_data_source_factory) |
| 105 template_data_source_factory = TemplateDataSource.Factory( | 105 template_data_source_factory = TemplateDataSource.Factory( |
| 106 channel_name, | 106 channel_name, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if path.startswith('/cron'): | 191 if path.startswith('/cron'): |
| 192 self._HandleCron(path) | 192 self._HandleCron(path) |
| 193 else: | 193 else: |
| 194 # Redirect paths like "directory" to "directory/". This is so relative | 194 # Redirect paths like "directory" to "directory/". This is so relative |
| 195 # file paths will know to treat this as a directory. | 195 # file paths will know to treat this as a directory. |
| 196 if os.path.splitext(path)[1] == '' and path[-1] != '/': | 196 if os.path.splitext(path)[1] == '' and path[-1] != '/': |
| 197 self.redirect(path + '/') | 197 self.redirect(path + '/') |
| 198 path = path.replace('/chrome/', '') | 198 path = path.replace('/chrome/', '') |
| 199 path = path.strip('/') | 199 path = path.strip('/') |
| 200 self._HandleGet(path) | 200 self._HandleGet(path) |
| OLD | NEW |