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

Side by Side 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, 7 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 from appengine_url_fetcher import AppEngineUrlFetcher
6 from appengine_wrappers import GetAppVersion
7 from object_store_creator import ObjectStoreCreator
8 #from servlet import Servlet
9
10 PATCH_BASEURL = '_patch/'
11 PATCH_CHANNEL_NAME = 'trunk'
12
13 class PatchServlet(object):
14 '''Servlet which renders patched docs.
15 '''
16 @staticmethod
17 def SplitPatchFromPath(path):
18 if path.startswith(PATCH_BASEURL):
19 remaining_path = path.split(PATCH_BASEURL, 1)[1]
20 if not '/' in remaining_path:
21 return (None, None, None)
22 issue, real_path = remaining_path.split('/', 1)
23 if not issue.isdigit() or len(real_path) == 0:
24 return (None, None, None)
25 return (PATCH_CHANNEL_NAME, issue, real_path)
26 else:
27 return (None, None, None)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698