)
self.styles.add(centered)
+ # Add a smaller style for the table content
+ small = reportlab.lib.styles.ParagraphStyle(
+ name = "Small",
+ parent = self.styles["Normal"],
+ fontSize = 8,
+ leading = 10,
+ )
+ self.styles.add(small)
+
def generate(self, output, year, month, week, day):
"""
Generates a PDF report.
# Append the row
rows.append((
+ # Time
t.strftime("%H:%M:%S"),
- "%s %s\n[%s:%s:%s] - %s" % (
- "*" * row.alert_severity,
- row.alert_signature,
- row.alert_gid,
- row.alert_signature_id,
- row.alert_rev,
- row.alert_category,
+
+ # Signature
+ reportlab.platypus.Paragraph(
+ "%s %s<br />[%s:%s:%s] - %s" % (
+ "*" * row.alert_severity,
+ row.alert_signature,
+ row.alert_gid,
+ row.alert_signature_id,
+ row.alert_rev,
+ row.alert_category,
+ ),
+ self.styles["Small"],
),
+
+ # Protocol
row.protocol,
+
+ # Source/Destination
"%s:%s\n%s:%s" % (
row.source_address, (row.source_port or row.icmp_code),
row.destination_address, (row.destination_port or row.icmp_type),