From 38276e7eab843c6be4d89a606ee240f9606c1b54 Mon Sep 17 00:00:00 2001 From: areza-blocpower Date: Tue, 18 Apr 2017 10:11:22 -0400 Subject: [PATCH] Changed input arg to the pandas dataframe instead of the excel file. Added excel file handling to the static method --- bpeng/reports/cbra_diag.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bpeng/reports/cbra_diag.py b/bpeng/reports/cbra_diag.py index 990590a..c0c9299 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)) -- GitLab