From 161f543e75799d3a1eada9206fb3c31fe05b1a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=20R=C3=B6mgens?= Date: Mon, 21 Mar 2016 19:53:07 +0100 Subject: [PATCH] Fix mismatch of empty headers at end of data --- ledenlijst.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ledenlijst.py b/ledenlijst.py index 3e7b392..e5c81ab 100755 --- a/ledenlijst.py +++ b/ledenlijst.py @@ -270,9 +270,10 @@ def read_xls(f): logger.critical("Last row in first column is not an integer. Please contact the ICT-team.") sys.exit(1) # Confirm first row matches with expectations - if sheet.row_values(0) != EXPECTED_HEADERS: - logger.critical("First row does not match expectations, possible format-change. Please contact the ICT-team if you are not completely sure what to do.") - sys.exit(1) + for header_expected, header in zip(EXPECTED_HEADERS, sheet.row_values(0)): + if header_expected != header: + logger.critical("First row does not match expectations, possible format-change. Please contact the ICT-team if you are not completely sure what to do.") + sys.exit(1) if sheet.nrows not in range(4000,7000): logger.critical("Total number of rows very different from hardcoded safeguard. Please contact the ICT-team.") sys.exit(1)