修改列表生成设置
parent
357292585c
commit
270aa001d4
|
|
@ -165,15 +165,15 @@ class ConfigGenerator:
|
||||||
def gen_config_json(self):
|
def gen_config_json(self):
|
||||||
sheet = self.sheet_helper.get_sheet_table(self.google_sheet_file_name, self.sheet_table_name)
|
sheet = self.sheet_helper.get_sheet_table(self.google_sheet_file_name, self.sheet_table_name)
|
||||||
sheet_all_row_datas = sheet.get_all_values(major_dimension='ROWS')
|
sheet_all_row_datas = sheet.get_all_values(major_dimension='ROWS')
|
||||||
config_json = {'datas': []}
|
config_json = {}
|
||||||
error_lines = []
|
error_lines = []
|
||||||
data_row_index = -1
|
list_field = ''
|
||||||
for i, row_values in enumerate(sheet_all_row_datas):
|
for i, row_values in enumerate(sheet_all_row_datas):
|
||||||
if data_row_index == -1:
|
if i <= 4:
|
||||||
if 'data' not in str(row_values[0]).lower():
|
continue
|
||||||
continue
|
if row_values[0] != '':
|
||||||
else:
|
list_field = row_values[0]
|
||||||
data_row_index = i
|
config_json[list_field] = []
|
||||||
|
|
||||||
if self.is_row_env_valid(row_values) is False:
|
if self.is_row_env_valid(row_values) is False:
|
||||||
continue
|
continue
|
||||||
|
|
@ -184,7 +184,7 @@ class ConfigGenerator:
|
||||||
elif len(item_data) == 0:
|
elif len(item_data) == 0:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
config_json['datas'].append(item_data)
|
config_json[list_field].append(item_data)
|
||||||
|
|
||||||
if len(error_lines) > 0:
|
if len(error_lines) > 0:
|
||||||
config.notification.append_msg(str(error_lines))
|
config.notification.append_msg(str(error_lines))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue