Skip to content

Commit 18d396a

Browse files
authored
Merge pull request #70 from fosslight/develop
Find sheet names without case sensitivity
2 parents 914b097 + d252e48 commit 18d396a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/fosslight_oss_pkg/_parsing_excel.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def write_yaml_file(output_file, json_output):
8383
def read_oss_report(excel_file, sheet_names=""):
8484
_oss_report_items = []
8585
_xl_sheets = []
86-
SHEET_PREFIX_TO_READ = ["BIN", "BOM", "SRC"]
86+
SHEET_PREFIX_TO_READ = ["bin", "bom", "src"]
8787
if sheet_names:
8888
sheet_name_prefix_math = False
8989
sheet_name_to_read = sheet_names.split(",")
@@ -96,8 +96,9 @@ def read_oss_report(excel_file, sheet_names=""):
9696
xl_workbook = xlrd.open_workbook(excel_file)
9797
for sheet_name in xl_workbook.sheet_names():
9898
try:
99-
if any(((sheet_name_prefix_math and sheet_name.startswith(sheet_to_read))
100-
or sheet_name == sheet_to_read)
99+
sheet_name_lower = sheet_name.lower()
100+
if any(((sheet_name_prefix_math and sheet_name_lower.startswith(sheet_to_read.lower()))
101+
or sheet_name_lower == sheet_to_read.lower())
101102
for sheet_to_read in sheet_name_to_read):
102103
sheet = xl_workbook.sheet_by_name(sheet_name)
103104
if sheet:

0 commit comments

Comments
 (0)