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

Unified Diff: Source/build/scripts/audit_runtime_enabled_features.py

Issue 339703002: Fix audit_runtime_enabled_features now that omahaproxy has headers in their CSV (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/audit_runtime_enabled_features.py
diff --git a/Source/build/scripts/audit_runtime_enabled_features.py b/Source/build/scripts/audit_runtime_enabled_features.py
index bd66f47e34c547b40312b5647600fc048a6b9253..fcd318f8e42a5b61842fc15d33e1f7f0494a43fe 100755
--- a/Source/build/scripts/audit_runtime_enabled_features.py
+++ b/Source/build/scripts/audit_runtime_enabled_features.py
@@ -47,7 +47,11 @@ def branch_from_version(version_string):
# Format: 31.0.1650.63, the second digit was only ever used for M4
# no clue what it's actually intended for.
version_regexp = r"(?P<major>\d+)\.\d+\.(?P<branch>\d+)\.(?P<minor>\d+)"
- return int(re.match(version_regexp, version_string).group('branch'))
+ match = re.match(version_regexp, version_string)
+ # if match == None, we'll blow up, so at least provide some debugging information:
+ if not match:
+ print version_string
+ return int(match.group('branch'))
def print_feature_diff(added_features, removed_features):
@@ -62,7 +66,11 @@ def historical_versions(os_string, channel):
url = url_pattern % (os_string, channel)
releases_csv = requests.get(url).text.strip("\n")
# Format: os,channel,version_string,date_string
- return [line.split(',')[2] for line in releases_csv.split("\n")]
+ lines = releases_csv.split('\n')
+ # As of June 2014, omahaproxy is now including headers:
+ assert(lines[0] == 'os,channel,version,timestamp')
+ # FIXME: We could replace this with more generic CSV parsing now that we have headers.
+ return [line.split(',')[2] for line in lines[1:]]
def feature_file_url_for_branch(branch):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698