diff --git a/bpeng/reports/cbra_diag.py b/bpeng/reports/cbra_diag.py index 990590a440667965577aba69b6035e8584d9abf2..c0c929931a3f369653151ef3d1a7f4eb1db519d6 100644 --- a/bpeng/reports/cbra_diag.py +++ b/bpeng/reports/cbra_diag.py @@ -21,7 +21,7 @@ class CbraDiagnostic: """ @staticmethod - def _generate_report(template_file, input_file): + def _generate_report(template_file, sheet_input): """ Generate powerpoint file @@ -34,8 +34,6 @@ class CbraDiagnostic: Presentation: the presenation generated """ - file_input = pd.ExcelFile(input_file) - sheet_input = file_input.parse("Inputs", header=None) input_list = sheet_input[0] input_values = sheet_input[1] @@ -44,7 +42,7 @@ class CbraDiagnostic: prs = Presentation(template_file) # Slide 1: cover slide - cover_slide_layout = prs.slide_layouts[0] + # cover_slide_layout = prs.slide_layouts[0] cover_slide = prs.slides[0] cover_title = cover_slide.shapes.title cover_subtitle = cover_slide.placeholders[1] @@ -274,5 +272,7 @@ class CbraDiagnostic: """ template_file = input('Enter Template Name (with .pptx extension): ') file_name = input('Enter File Name (with .xlsx extension): ') - project_address, prs = CbraDiagnostic._generate_report(template_file, file_name) + file_input = pd.ExcelFile(file_name) + sheet_input = file_input.parse("Inputs", header=None) + project_address, prs = CbraDiagnostic._generate_report(template_file, sheet_input) prs.save('EEDR {}.pptx'.format(project_address))