Update app.py
Browse files
app.py
CHANGED
@@ -112,10 +112,29 @@ def generate_pdf_report(results):
|
|
112 |
pdf.set_font("Arial", 'B', 14)
|
113 |
pdf.multi_cell(200, 10, txt=f"Requirement R{i}: {result['Requirement']}", align='L')
|
114 |
pdf.set_font("Arial", size=12)
|
115 |
-
|
116 |
-
|
117 |
-
pdf.
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
pdf.multi_cell(200, 10, txt="-" * 50, align='L')
|
120 |
pdf.ln(5)
|
121 |
|
|
|
112 |
pdf.set_font("Arial", 'B', 14)
|
113 |
pdf.multi_cell(200, 10, txt=f"Requirement R{i}: {result['Requirement']}", align='L')
|
114 |
pdf.set_font("Arial", size=12)
|
115 |
+
|
116 |
+
# Add Type with colored background
|
117 |
+
pdf.set_fill_color(232, 245, 233) # Light green for functional
|
118 |
+
if "non-functional" in result['Type'].lower():
|
119 |
+
pdf.set_fill_color(255, 243, 224) # Light orange for non-functional
|
120 |
+
pdf.cell(40, 10, txt="Type:", ln=0, fill=True)
|
121 |
+
pdf.cell(0, 10, txt=f" {result['Type']}", ln=True)
|
122 |
+
|
123 |
+
# Add Domain
|
124 |
+
pdf.set_fill_color(227, 242, 253) # Light blue
|
125 |
+
pdf.cell(40, 10, txt="Domain:", ln=0, fill=True)
|
126 |
+
pdf.cell(0, 10, txt=f" {result['Domain']}", ln=True)
|
127 |
+
|
128 |
+
# Add Defects
|
129 |
+
pdf.set_fill_color(255, 235, 238) # Light red
|
130 |
+
pdf.cell(40, 10, txt="Defects:", ln=0, fill=True)
|
131 |
+
pdf.multi_cell(0, 10, txt=f" {result['Defects']}")
|
132 |
+
|
133 |
+
# Add Rewritten version
|
134 |
+
pdf.set_fill_color(220, 237, 200) # Light green
|
135 |
+
pdf.cell(40, 10, txt="Improved:", ln=0, fill=True)
|
136 |
+
pdf.multi_cell(0, 10, txt=f" {result['Rewritten']}")
|
137 |
+
|
138 |
pdf.multi_cell(200, 10, txt="-" * 50, align='L')
|
139 |
pdf.ln(5)
|
140 |
|