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

Unified Diff: chrome/common/extensions/docs/server2/patch_servlet.py

Issue 14125010: Docserver: Add support for viewing docs with a codereview patch applied (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 8 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/patch_servlet.py
===================================================================
--- chrome/common/extensions/docs/server2/patch_servlet.py (revision 0)
+++ chrome/common/extensions/docs/server2/patch_servlet.py (revision 0)
@@ -0,0 +1,27 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from appengine_url_fetcher import AppEngineUrlFetcher
+from appengine_wrappers import GetAppVersion
+from object_store_creator import ObjectStoreCreator
+#from servlet import Servlet
+
+PATCH_BASEURL = '_patch/'
+PATCH_CHANNEL_NAME = 'trunk'
+
+class PatchServlet(object):
+ '''Servlet which renders patched docs.
+ '''
+ @staticmethod
+ def SplitPatchFromPath(path):
+ if path.startswith(PATCH_BASEURL):
+ remaining_path = path.split(PATCH_BASEURL, 1)[1]
+ if not '/' in remaining_path:
+ return (None, None, None)
+ issue, real_path = remaining_path.split('/', 1)
+ if not issue.isdigit() or len(real_path) == 0:
+ return (None, None, None)
+ return (PATCH_CHANNEL_NAME, issue, real_path)
+ else:
+ return (None, None, None)
Property changes on: chrome/common/extensions/docs/server2/patch_servlet.py
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698