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

Unified Diff: chrome/common/extensions/docs/server2/branch_utility.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/branch_utility.py
diff --git a/chrome/common/extensions/docs/server2/branch_utility.py b/chrome/common/extensions/docs/server2/branch_utility.py
index b1470c2e38c43593282adf2962ec20a2ead361af..166c1a9b52f1ccd5e26041268a1cc6080eea47c0 100644
--- a/chrome/common/extensions/docs/server2/branch_utility.py
+++ b/chrome/common/extensions/docs/server2/branch_utility.py
@@ -15,15 +15,22 @@ class BranchUtility(object):
self._memcache = memcache
def SplitChannelNameFromPath(self, path):
+ prefix = ''
+ if path.startswith('extensions/'):
+ prefix = 'extensions/'
+ path = path[len('extensions/'):]
+ elif path.startswith('apps/'):
+ prefix = 'apps/'
+ path = path[len('apps/'):]
try:
first, second = path.split('/', 1)
except ValueError:
first = path
second = ''
if first in ['trunk', 'dev', 'beta', 'stable']:
- return (first, second)
+ return (first, prefix + second)
else:
- return (self._default_branch, path)
+ return (self._default_branch, prefix + path)
def GetBranchNumberForChannelName(self, channel_name):
"""Returns an empty string if the branch number cannot be found.
« no previous file with comments | « chrome/common/extensions/docs/server2/api_list_data_source.py ('k') | chrome/common/extensions/docs/server2/handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698