Skip to content
Snippets Groups Projects
Commit 4ad4b4c6 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Fix code

parent 358f6d4c
No related branches found
No related tags found
No related merge requests found
...@@ -501,7 +501,7 @@ def create_xls_document(args, headers, filtered_records, nb_records, nb_inds, ce ...@@ -501,7 +501,7 @@ def create_xls_document(args, headers, filtered_records, nb_records, nb_inds, ce
try: try:
import xlsxwriter import xlsxwriter
except ImportError: except ImportError:
print("Excel file not built: xslxwriter python module not installed") print("\nWARN: Excel file not built: xlsxwriter python module not installed")
return False return False
with xlsxwriter.Workbook(args.output + ".xslx") as workbook: with xlsxwriter.Workbook(args.output + ".xslx") as workbook:
...@@ -555,6 +555,7 @@ def create_xls_document(args, headers, filtered_records, nb_records, nb_inds, ce ...@@ -555,6 +555,7 @@ def create_xls_document(args, headers, filtered_records, nb_records, nb_inds, ce
# Resize columns: # Resize columns:
worksheet_gq.set_column(0, 0, max_col_len[0]+1) worksheet_gq.set_column(0, 0, max_col_len[0]+1)
return True
def create_tsv_file(filename: str, headers: list, cells: dict, nb_tools: int, nb_per_tool: int, records_range: ()): def create_tsv_file(filename: str, headers: list, cells: dict, nb_tools: int, nb_per_tool: int, records_range: ()):
...@@ -810,9 +811,10 @@ def main(): ...@@ -810,9 +811,10 @@ def main():
i += 1 i += 1
# Create document: # Create document:
with_xlsx = False
if not args.no_xls: if not args.no_xls:
create_xls_document(args, headers, filtered_records is not None, nb_records, nb_inds, cells, cells_gt, cells_gq, with_xlsx = create_xls_document(args, headers, filtered_records is not None, nb_records, nb_inds, cells, cells_gt, cells_gq,
max_col_len) max_col_len)
# Create CSV files: # Create CSV files:
create_tsv_file(args.output + "_sv_per_tools.tsv", headers, cells, create_tsv_file(args.output + "_sv_per_tools.tsv", headers, cells,
...@@ -837,7 +839,7 @@ def main(): ...@@ -837,7 +839,7 @@ def main():
print(str(nb_records) + " Results found") print(str(nb_records) + " Results found")
print(str(orphans) + " False Positive") print(str(orphans) + " False Positive")
print("") print("")
if not args.no_xls: if with_xlsx:
print("Results saved in :\n\t- " + args.output + ".xslx") print("Results saved in :\n\t- " + args.output + ".xslx")
else: else:
print("Results:") print("Results:")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment