-<DIV STYLE="border-radius: 25px; border-style: solid; padding: 20px; background-color: %s; color: #eeeeee; font-size: x-large;">
-<p style="color: #ffffff; font-size:larger"><B>%s</B></p>
-<HR style="border-top: 3px solid white;">""" % (color, note.title))
- if num_lines >= 12 and max_length < 120:
- self.debug_print("%d lines (max=%d chars): two columns" %
- (num_lines, max_length))
- f.write("<TABLE BORDER=0 WIDTH=100%%><TR valign=\"top\">")
- f.write("<TD WIDTH=50%% style=\"color:#eeeeee; font-size:large\">\n")
- f.write("<FONT><UL STYLE='list-style-type:none'>")
- count = 0
- for x in individual_lines:
- f.write(x + "\n")
- count += 1
- if count == num_lines / 2:
- f.write("</UL></FONT></TD>\n")
- f.write("<TD WIDTH=50%% style=\"color:#eeeeee; font-size:large\">\n")
- f.write("<FONT><UL STYLE='list-style-type:none'>")
- f.write("</UL></FONT></TD></TR></TABLE></DIV>\n");
- else:
- self.debug_print("%d lines (max=%d chars): one column" %
- (num_lines, max_length))
- f.write("<FONT><UL>%s</UL></FONT>" % contents)
- f.write("</DIV>")
- f.close()
+<DIV STYLE="border-radius:25px; border-style:solid; padding:20px; background-color:%s; color:#eeeeee; font-size:x-large;">
+"""
+ % color
+ )
+ f.write(
+ f"""
+<p style="color:#ffffff; font-size:larger"><B>{note.title}</B></p>
+<HR style="border-top:3px solid white;">
+"""
+ )
+ if num_lines >= 10:
+ logger.debug(f"{num_lines} lines: two column mode")
+ f.write('<TABLE BORDER=0 WIDTH=100%><TR valign="top">')
+ f.write(
+ '<TD WIDTH=50% style="color:#eeeeee; font-size:large">\n'
+ )
+ f.write("<FONT><UL STYLE='list-style-type:none'>")
+ count = 0
+ for x in individual_lines:
+ f.write(x + "\n")
+ count += 1
+ if count == num_lines / 2:
+ f.write("</UL></FONT></TD>\n")
+ f.write(
+ '<TD WIDTH=50% style="color:#eeeeee; font-size:large">\n'
+ )
+ f.write("<FONT><UL STYLE='list-style-type:none'>")
+ f.write("</UL></FONT></TD></TR></TABLE></DIV>")
+ else:
+ logger.debug(f"{num_lines} lines: one column mode")
+ f.write(f"<FONT><UL>{contents}</UL></FONT>")
+ f.write("</DIV>")