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 import sys | 7 import sys |
8 | 8 |
9 from appengine_wrappers import webapp | 9 from appengine_wrappers import webapp |
10 from appengine_wrappers import memcache | 10 from appengine_wrappers import memcache |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 # TODO: This leaks Server instances when branch bumps. | 118 # TODO: This leaks Server instances when branch bumps. |
119 _GetInstanceForBranch(branch, self._local_path).Get(real_path, | 119 _GetInstanceForBranch(branch, self._local_path).Get(real_path, |
120 self.request, | 120 self.request, |
121 self.response) | 121 self.response) |
122 | 122 |
123 def get(self): | 123 def get(self): |
124 path = self.request.path | 124 path = self.request.path |
125 if '_ah/warmup' in path: | 125 if '_ah/warmup' in path: |
126 logging.info('Warmup request.') | 126 logging.info('Warmup request.') |
127 if DEFAULT_BRANCH != 'local': | 127 if DEFAULT_BRANCH != 'local': |
128 self._NavigateToPath('trunk/samples.html') | 128 self._NavigateToPath('extensions/trunk/samples.html') |
129 self._NavigateToPath('dev/samples.html') | 129 self._NavigateToPath('extensions/dev/samples.html') |
130 self._NavigateToPath('beta/samples.html') | 130 self._NavigateToPath('extensions/beta/samples.html') |
131 self._NavigateToPath('stable/samples.html') | 131 self._NavigateToPath('extensions/stable/samples.html') |
132 return | 132 return |
133 | 133 |
134 # Redirect paths like "directory" to "directory/". This is so relative file | 134 # Redirect paths like "directory" to "directory/". This is so relative file |
135 # paths will know to treat this as a directory. | 135 # paths will know to treat this as a directory. |
136 if os.path.splitext(path)[1] == '' and path[-1] != '/': | 136 if os.path.splitext(path)[1] == '' and path[-1] != '/': |
137 self.redirect(path + '/') | 137 self.redirect(path + '/') |
138 path = path.replace('/chrome/extensions/', '') | 138 path = path.replace('/chrome/', '') |
139 path = path.strip('/') | 139 path = path.strip('/') |
140 self._NavigateToPath(path) | 140 self._NavigateToPath(path) |
OLD | NEW |