)
self.styles.add(small)
+ # Add a light styling for notes
+ note = reportlab.lib.styles.ParagraphStyle(
+ name = "Note",
+ parent = self.styles["Centered"],
+ textColor = reportlab.lib.colors.grey,
+ spaceBefore = 1 * cm,
+ spaceAfter = 1 * cm,
+ )
+ self.styles.add(note)
+
def generate(self, output, year, month, week, day):
"""
Generates a PDF report.
),
))
- # Skip if we have found no data
- if len(rows) == 1:
- log.debug("Skipping %s, because we don't have any data" % date)
- return
-
# Add a headline
elements.append(
reportlab.platypus.Paragraph(
)
)
+ # Just add a note if there have not been any alerts
+ if not i:
+ elements.append(
+ reportlab.platypus.Paragraph(
+ _("No Alerts Have Been Reported"),
+ self.styles["Note"],
+ ),
+ )
+
+ # Done
+ return
+
# Create the table
table = reportlab.platypus.Table(rows,
# Set the widths of the rows