summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/travis_new_boards_check.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/travis_new_boards_check.py b/tools/travis_new_boards_check.py
index b12f6d127..0d6d4ebf9 100644
--- a/tools/travis_new_boards_check.py
+++ b/tools/travis_new_boards_check.py
@@ -8,9 +8,9 @@ import build_board_info
# Get boards in json format
boards_info_json = build_board_info.get_board_mapping()
-# print(boards_info_json)
-# TODO (Carlos) Find all the boards on the json format
+# Get all the boards out of the json format
+info_boards = boards_info_json.keys()
# We need to know the path of the .travis.yml file
base_path = os.path.dirname(__file__)
@@ -22,12 +22,15 @@ with open(travis_path, 'r') as travis:
# Get all lines that contain the substring 'TRAVIS_BOARDS'
for line in travis:
- line = travis.readline()
- if 'TRAVIS_BOARDS' in line:
- print('TRAVIS_BOARDS found')
- print(line)
- # TODO (Carlos) Store the line content
+ # Get the lines with TRAVIS_BOARDS= in it
+ if line.find('TRAVIS_BOARDS=') is not -1:
+ # Store all the boards names into travis_boards
+ begin_of_names = line.find('TRAVIS_BOARDS=') + len('TRAVIS_BOARDS=') + 1
+ end_of_names = line.rfind('"')
+ boards = line[begin_of_names:end_of_names]
+ boards = boards.split(' ')
+ travis_boards.extend(boards)
# We've reached the end of the env: section
elif 'addons' in line:
@@ -35,8 +38,4 @@ with open(travis_path, 'r') as travis:
else:
pass
- # TODO (Carlos) Getting all the boards on TRAVIS_BOARDS using regex matching
- # Tranks sommersoft for the pattern
- pattern = '(.+)'
-
# TODO (Carlos) Comparing boards listed in TRAVIS_BOARDS and boards got from get_board_mapping