| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import cStringIO | 5 import cStringIO |
| 6 import csv | 6 import csv |
| 7 | 7 |
| 8 from slave import recipe_api | 8 from recipe_engine import recipe_api |
| 9 | 9 |
| 10 | 10 |
| 11 class OmahaproxyApi(recipe_api.RecipeApi): | 11 class OmahaproxyApi(recipe_api.RecipeApi): |
| 12 """APIs for interacting with omahaproxy.""" | 12 """APIs for interacting with omahaproxy.""" |
| 13 | 13 |
| 14 @staticmethod | 14 @staticmethod |
| 15 def split_version(text): | 15 def split_version(text): |
| 16 result = [int(x) for x in text.split('.')] | 16 result = [int(x) for x in text.split('.')] |
| 17 assert len(result) == 4 | 17 assert len(result) == 4 |
| 18 return result | 18 return result |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 data = list(csv_reader) | 32 data = list(csv_reader) |
| 33 header = data[0] | 33 header = data[0] |
| 34 for row in data[1:]: | 34 for row in data[1:]: |
| 35 candidate = {header[i]: row[i] for i in range(len(row))} | 35 candidate = {header[i]: row[i] for i in range(len(row))} |
| 36 if (min_major_version and | 36 if (min_major_version and |
| 37 self.split_version(candidate['version'])[0] < min_major_version): | 37 self.split_version(candidate['version'])[0] < min_major_version): |
| 38 continue | 38 continue |
| 39 if row[0].strip() in exclude_platforms: | 39 if row[0].strip() in exclude_platforms: |
| 40 continue | 40 continue |
| 41 yield candidate | 41 yield candidate |
| OLD | NEW |