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

Unified 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: clean up 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/handler.py
diff --git a/chrome/common/extensions/docs/server2/handler.py b/chrome/common/extensions/docs/server2/handler.py
index 92e7c77e7c7c399ce7b59ccba2ababe006d84b6d..019d855723c19f8e2bb7a36698856bb8737c89cc 100644
--- a/chrome/common/extensions/docs/server2/handler.py
+++ b/chrome/common/extensions/docs/server2/handler.py
@@ -113,8 +113,11 @@ class Handler(webapp.RequestHandler):
def _NavigateToPath(self, path):
channel_name, real_path = BRANCH_UTILITY.SplitChannelNameFromPath(path)
branch = BRANCH_UTILITY.GetBranchNumberForChannelName(channel_name)
- if real_path == '':
- real_path = 'index.html'
+ # TODO: Detect that these are directories and serve index.html out of them.
+ if real_path.strip('/') == 'apps':
+ real_path = 'apps/index.html'
+ if real_path.strip('/') == 'extensions':
+ real_path = 'extensions/index.html'
# TODO: This leaks Server instances when branch bumps.
_GetInstanceForBranch(branch, self._local_path).Get(real_path,
self.request,
@@ -125,16 +128,16 @@ class Handler(webapp.RequestHandler):
if '_ah/warmup' in path:
logging.info('Warmup request.')
if DEFAULT_BRANCH != 'local':
- self._NavigateToPath('trunk/samples.html')
- self._NavigateToPath('dev/samples.html')
- self._NavigateToPath('beta/samples.html')
- self._NavigateToPath('stable/samples.html')
+ self._NavigateToPath('extensions/trunk/samples.html')
+ self._NavigateToPath('extensions/dev/samples.html')
+ self._NavigateToPath('extensions/beta/samples.html')
+ self._NavigateToPath('extensions/stable/samples.html')
return
# Redirect paths like "directory" to "directory/". This is so relative file
# paths will know to treat this as a directory.
if os.path.splitext(path)[1] == '' and path[-1] != '/':
self.redirect(path + '/')
- path = path.replace('/chrome/extensions/', '')
+ path = path.replace('/chrome/', '')
path = path.strip('/')
self._NavigateToPath(path)
« no previous file with comments | « chrome/common/extensions/docs/server2/branch_utility.py ('k') | chrome/common/extensions/docs/server2/integration_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698