Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: chrome/common/extensions/docs/server2/handler.py

Issue 10834144: Extensions Docs Server: Split apps from extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reworked Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698