From 90b7d4930e27c7dd98223c618a625cc08c205731 Mon Sep 17 00:00:00 2001 From: JiaJunsu Date: Sat, 1 Sep 2018 07:41:08 -0700 Subject: [PATCH] Add mitama serial check --- calculator_of_Onmyoji/load_data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/calculator_of_Onmyoji/load_data.py b/calculator_of_Onmyoji/load_data.py index 9e47091..8efa387 100644 --- a/calculator_of_Onmyoji/load_data.py +++ b/calculator_of_Onmyoji/load_data.py @@ -96,7 +96,10 @@ def get_mitama_data_xls(filename, ignore_serial): prop_name = data_format.MITAMA_COL_NAME_ZH[i] data[prop_name] = float(r_data[i].value) if r_data[i].value else 0 - mitama_data[serial] = data + if serial in mitama_data: + print('Mitama serial must be unique %s' % serial) + raise ValueError + mitama_data.setdefault(serial, data) return mitama_data