Fix be_list Results error

This commit is contained in:
2022-11-22 16:26:24 +01:00
parent 8aa76c27c3
commit 5d7ed6f1ed

View File

@@ -1511,9 +1511,9 @@ class Summary:
get_input(message="Press enter to continue") get_input(message="Press enter to continue")
self.list_results() self.list_results()
cmd = SimpleNamespace(quit="q", relist="r", delete="d", excel="e") cmd = SimpleNamespace(
if not self.hidden: quit="q", relist="r", delete="d", hide="h", excel="e"
cmd.hide = "h" )
message = ( message = (
TextColor.ENDC TextColor.ENDC
+ f"Choose option {str(cmd).replace('namespace', '')}: " + f"Choose option {str(cmd).replace('namespace', '')}: "
@@ -1530,14 +1530,11 @@ class Summary:
book.close() book.close()
return True return True
return False return False
case [ case [cmd.hide, num] if num.isdigit() and int(num) < max_value:
cmd.hide, if self.hidden:
num, print("Already hidden")
] if not self.hidden and num.isdigit() and int( else:
num process_file(num, path=path, command=cmd.hide)
) < max_value:
process_file(num, path=path, command=cmd.hide)
case [cmd.delete, num] if num.isdigit() and int( case [cmd.delete, num] if num.isdigit() and int(
num num
) < max_value: ) < max_value:
@@ -1546,6 +1543,7 @@ class Summary:
num num
) < max_value: ) < max_value:
# Add to excel file result #num # Add to excel file result #num
num = int(num)
file_name_result = os.path.join( file_name_result = os.path.join(
path, self.data_filtered[num]["file"] path, self.data_filtered[num]["file"]
) )
@@ -1563,6 +1561,7 @@ class Summary:
print(f"Added {file_name_result} to {Files.be_list_excel}") print(f"Added {file_name_result} to {Files.be_list_excel}")
case [num] if num.isdigit() and int(num) < max_value: case [num] if num.isdigit() and int(num) < max_value:
# Report the result #num # Report the result #num
num = int(num)
file_name_result = os.path.join( file_name_result = os.path.join(
path, self.data_filtered[num]["file"] path, self.data_filtered[num]["file"]
) )