iisadia commited on
Commit
861d673
·
verified ·
1 Parent(s): ff471d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -83,7 +83,7 @@ def analyze_requirement(requirement):
83
  }
84
 
85
  # Function to generate a PDF report
86
- def generate_pdf_report(st.session_state.results):
87
  pdf = FPDF()
88
  pdf.add_page()
89
  pdf.set_font("Arial", size=12)
@@ -109,6 +109,7 @@ def generate_pdf_report(st.session_state.results):
109
  if pdf.get_y() > 250: # If the content is near the bottom of the page
110
  pdf.add_page() # Add a new page
111
  pdf.set_font("Arial", 'B', 16)
 
112
  pdf.cell(200, 10, txt="AI Powered Requirement Analysis and Defect Detection", ln=True, align='C')
113
  pdf.set_font("Arial", size=12)
114
  pdf.cell(200, 10, txt=f"Report Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", ln=True, align='C')
@@ -118,6 +119,7 @@ def generate_pdf_report(st.session_state.results):
118
  pdf.set_font("Arial", 'B', 14)
119
  pdf.multi_cell(200, 10, txt=f"Requirement R{i}: {result['Requirement']}", align='L')
120
  pdf.set_font("Arial", size=12)
 
121
  pdf.multi_cell(200, 10, txt=f"Type: {result['Type']}", align='L')
122
  pdf.multi_cell(200, 10, txt=f"Domain: {result['Domain']}", align='L')
123
  pdf.multi_cell(200, 10, txt=f"Defects: {result['Defects']}", align='L')
 
83
  }
84
 
85
  # Function to generate a PDF report
86
+ def generate_pdf_report(results):
87
  pdf = FPDF()
88
  pdf.add_page()
89
  pdf.set_font("Arial", size=12)
 
109
  if pdf.get_y() > 250: # If the content is near the bottom of the page
110
  pdf.add_page() # Add a new page
111
  pdf.set_font("Arial", 'B', 16)
112
+ pdf.set_text_color(0, 0, 0) # Black color for title
113
  pdf.cell(200, 10, txt="AI Powered Requirement Analysis and Defect Detection", ln=True, align='C')
114
  pdf.set_font("Arial", size=12)
115
  pdf.cell(200, 10, txt=f"Report Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", ln=True, align='C')
 
119
  pdf.set_font("Arial", 'B', 14)
120
  pdf.multi_cell(200, 10, txt=f"Requirement R{i}: {result['Requirement']}", align='L')
121
  pdf.set_font("Arial", size=12)
122
+ pdf.set_text_color(0, 0, 0) # Black color for title
123
  pdf.multi_cell(200, 10, txt=f"Type: {result['Type']}", align='L')
124
  pdf.multi_cell(200, 10, txt=f"Domain: {result['Domain']}", align='L')
125
  pdf.multi_cell(200, 10, txt=f"Defects: {result['Defects']}", align='L')