OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 # Add the original server location to sys.path so we are able to import | 10 # Add the original server location to sys.path so we are able to import |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return SERVER_INSTANCES[branch] | 71 return SERVER_INSTANCES[branch] |
72 if branch == 'local': | 72 if branch == 'local': |
73 file_system = LocalFileSystem(EXTENSIONS_PATH) | 73 file_system = LocalFileSystem(EXTENSIONS_PATH) |
74 else: | 74 else: |
75 fetcher = AppEngineUrlFetcher( | 75 fetcher = AppEngineUrlFetcher( |
76 _GetURLFromBranch(branch) + '/' + EXTENSIONS_PATH) | 76 _GetURLFromBranch(branch) + '/' + EXTENSIONS_PATH) |
77 file_system = MemcacheFileSystem(SubversionFileSystem(fetcher), | 77 file_system = MemcacheFileSystem(SubversionFileSystem(fetcher), |
78 AppEngineMemcache(branch, memcache)) | 78 AppEngineMemcache(branch, memcache)) |
79 | 79 |
80 cache_builder = FileSystemCache.Builder(file_system) | 80 cache_builder = FileSystemCache.Builder(file_system) |
81 api_data_source = APIDataSource(cache_builder, API_PATH) | 81 api_data_source = APIDataSource(cache_builder, file_system, API_PATH) |
82 api_list_data_source = APIListDataSource(cache_builder, | 82 api_list_data_source = APIListDataSource(cache_builder, |
83 file_system, | 83 file_system, |
84 API_PATH, | 84 API_PATH, |
85 PUBLIC_TEMPLATE_PATH) | 85 PUBLIC_TEMPLATE_PATH) |
86 intro_data_source = IntroDataSource(cache_builder, | 86 intro_data_source = IntroDataSource(cache_builder, |
87 [INTRO_PATH, ARTICLE_PATH]) | 87 [INTRO_PATH, ARTICLE_PATH]) |
88 samples_data_source_factory = SamplesDataSource.Factory(branch, | 88 samples_data_source_factory = SamplesDataSource.Factory(branch, |
89 file_system, | 89 file_system, |
90 cache_builder, | 90 cache_builder, |
91 EXAMPLES_PATH) | 91 EXAMPLES_PATH) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 # TODO: This leaks Server instances when branch bumps. | 132 # TODO: This leaks Server instances when branch bumps. |
133 self._GetInstanceForBranch(branch).Get(real_path, | 133 self._GetInstanceForBranch(branch).Get(real_path, |
134 self.request, | 134 self.request, |
135 self.response) | 135 self.response) |
136 | 136 |
137 def main(): | 137 def main(): |
138 run_wsgi_app(webapp.WSGIApplication([('/.*', Handler)], debug=False)) | 138 run_wsgi_app(webapp.WSGIApplication([('/.*', Handler)], debug=False)) |
139 | 139 |
140 if __name__ == '__main__': | 140 if __name__ == '__main__': |
141 main() | 141 main() |
OLD | NEW |