diff options
author | Stephen Warren <swarren@nvidia.com> | 2015-03-17 13:27:30 -0600 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2015-03-25 12:02:51 -0600 |
commit | d5a43a4bc02221bbeb25629e9acf490e61eab552 (patch) | |
tree | 85b7b177a088c9794895ec4a28e10b15e36ff638 /csv-to-board.py | |
parent | f69acc27558b8104cf17baa0799cb4447d6d6df8 (diff) | |
download | tegra-pinmux-scripts-d5a43a4bc02221bbeb25629e9acf490e61eab552.tar.gz |
csv-to-board: handle missing package columns
Some board spreadsheets may have irrelevant package columns removed,
leaving only the package column that the specific board uses. Update
csv-to-board to handle missing package columns.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'csv-to-board.py')
-rwxr-xr-x | csv-to-board.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/csv-to-board.py b/csv-to-board.py index 2860c02..b2d1c46 100755 --- a/csv-to-board.py +++ b/csv-to-board.py @@ -190,18 +190,27 @@ with open(board_conf['filename'], newline='') as fh: try: cols[colid] = row.index(coltext) except: - if board_conf['soc'] != 'tegra124': - raise - if colid != COL_RCV_SEL: - print('ERROR: Header column "%s" not found' % coltext, file=sys.stderr) - sys.exit(1) + if colid in (COL_BALL_MID, COL_BALL_DSC): + pass + else: + if board_conf['soc'] != 'tegra124': + raise + if colid != COL_RCV_SEL: + print('ERROR: Header column "%s" not found' % coltext, file=sys.stderr) + sys.exit(1) cols[colid] = None found_header = True continue ball_name = row[cols[COL_BALL_NAME]].lower() - ball_mid = row[cols[COL_BALL_MID]] - ball_dsc = row[cols[COL_BALL_DSC]] + if cols[COL_BALL_MID]: + ball_mid = row[cols[COL_BALL_MID]] + else: + ball_mid = None + if cols[COL_BALL_DSC]: + ball_dsc = row[cols[COL_BALL_DSC]] + else: + ball_dsc = None # Section title row if not ball_mid and not ball_dsc: |