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

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

Issue 314133004: Docserver: Use the testing URL for the new omahaproxy history API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 49fd11f1459094c50577a76840a5c9624ac19641..51b253f0e2f461b401226ba99da9b37a210df283 100644
--- a/chrome/common/extensions/docs/server2/branch_utility.py
+++ b/chrome/common/extensions/docs/server2/branch_utility.py
@@ -166,7 +166,7 @@ class BranchUtility(object):
numbers = {}
for entry in version_json:
- if entry['os'] not in ['win', 'linux', 'mac', 'cros']:
+ if entry['os'] not in ('win', 'linux', 'mac', 'cros'):
continue
for version in entry['versions']:
if version['channel'] != channel_name:
@@ -198,9 +198,8 @@ class BranchUtility(object):
return branch
version_json = json.loads(self._history_result.Get().content)
- for entry in version_json['events']:
- # Here, entry['title'] looks like: '<title> - <version>.##.<branch>.##'
- version_title = entry['title'].split(' - ')[1].split('.')
+ for entry in version_json:
+ version_title = entry['version'].split('.')
if version_title[0] == str(version):
self._branch_object_store.Set(str(version), version_title[2])
return version_title[2]
@@ -227,8 +226,8 @@ class BranchUtility(object):
version_json = json.loads(self._history_result.Get().content)
latest_version = 0
- for entry in version_json['events']:
- version_title = entry['title'].split(' - ')[1].split('.')
+ for entry in version_json:
+ version_title = entry['version'].split('.')
version = int(version_title[0])
if version > latest_version:
latest_version = version
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/server2/branch_utility_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698