def check_noequations(self):
"""
Verify that no column in a sheet contains an equation
Based on checking every cell in the 4th row
Keyword arguments:
sheet -- sheet object from workbook
"""
wb_open = load_workbook(self.path, read_only = True)
sheet = wb_open.get_sheet_by_name(self.name)
for i in range(1, len(self.header_entries)):
for j in range(1,5):
value = sheet.cell(row = j, column = i).value
# equation check logic, TODO might be better code out there
if (value and isinstance(value, str) and value[0] == "="):
raise AMIExcelError("Cell R4C{0} contain equations."
.format(i))
return True
评论列表
文章目录