| 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 | 5 import logging |
| 6 import time | 6 import time |
| 7 import traceback | 7 import traceback |
| 8 | 8 |
| 9 from app_yaml_helper import AppYamlHelper | 9 from app_yaml_helper import AppYamlHelper |
| 10 from appengine_wrappers import ( | 10 from appengine_wrappers import ( |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 channel, delegate.GetAppVersion(), safe_revision)) | 210 channel, delegate.GetAppVersion(), safe_revision)) |
| 211 | 211 |
| 212 return self._CreateServerInstance(channel, safe_revision) | 212 return self._CreateServerInstance(channel, safe_revision) |
| 213 | 213 |
| 214 def _CreateObjectStoreCreator(self, channel): | 214 def _CreateObjectStoreCreator(self, channel): |
| 215 return ObjectStoreCreator(channel, start_empty=True) | 215 return ObjectStoreCreator(channel, start_empty=True) |
| 216 | 216 |
| 217 def _GetBranchForChannel(self, channel): | 217 def _GetBranchForChannel(self, channel): |
| 218 object_store_creator = self._CreateObjectStoreCreator(channel) | 218 object_store_creator = self._CreateObjectStoreCreator(channel) |
| 219 return (self._delegate.CreateBranchUtility(object_store_creator) | 219 return (self._delegate.CreateBranchUtility(object_store_creator) |
| 220 .GetBranchForChannel(channel)) | 220 .GetChannelInfo(channel).branch) |
| 221 | 221 |
| 222 def _CreateServerInstance(self, channel, revision): | 222 def _CreateServerInstance(self, channel, revision): |
| 223 object_store_creator = self._CreateObjectStoreCreator(channel) | 223 object_store_creator = self._CreateObjectStoreCreator(channel) |
| 224 host_file_system = CachingFileSystem( | 224 host_file_system = CachingFileSystem( |
| 225 self._delegate.CreateHostFileSystemForBranchAndRevision( | 225 self._delegate.CreateHostFileSystemForBranchAndRevision( |
| 226 self._GetBranchForChannel(channel), | 226 self._GetBranchForChannel, |
| 227 revision), | 227 revision), |
| 228 object_store_creator) | 228 object_store_creator) |
| 229 app_samples_file_system = self._delegate.CreateAppSamplesFileSystem( | 229 app_samples_file_system = self._delegate.CreateAppSamplesFileSystem( |
| 230 object_store_creator) | 230 object_store_creator) |
| 231 compiled_host_fs_factory = CompiledFileSystem.Factory( | 231 compiled_host_fs_factory = CompiledFileSystem.Factory( |
| 232 host_file_system, | 232 host_file_system, |
| 233 object_store_creator) | 233 object_store_creator) |
| 234 def create_file_system(branch): |
| 235 return CachingFileSystem(SubversionFileSystem.Create(branch), |
| 236 object_store_creator) |
| 234 return ServerInstance(channel, | 237 return ServerInstance(channel, |
| 235 object_store_creator, | 238 object_store_creator, |
| 236 host_file_system, | 239 host_file_system, |
| 237 app_samples_file_system, | 240 app_samples_file_system, |
| 238 '/static' if channel == 'stable' else | 241 '/static' if channel == 'stable' else |
| 239 '/%s/static' % channel, | 242 '/%s/static' % channel, |
| 240 compiled_host_fs_factory) | 243 compiled_host_fs_factory, |
| 244 create_file_system) |
| OLD | NEW |