individual_lines = contents.split("\n")
num_lines = len(individual_lines)
- max_length = 0
contents = ""
for x in individual_lines:
length = len(x)
- if length > max_length:
- max_length = length
leading_spaces = len(x) - len(x.lstrip(" "))
leading_spaces //= 2
leading_spaces = int(leading_spaces)
<HR style="border-top:3px solid white;">
"""
)
- if num_lines >= 12 and max_length < 120:
+ if num_lines >= 12:
logger.debug(
- f"{num_lines} lines (max={max_length} chars): two columns"
+ f"{num_lines} lines: two column mode"
)
f.write('<TABLE BORDER=0 WIDTH=100%><TR valign="top">')
f.write(
f.write("</UL></FONT></TD></TR></TABLE></DIV>\n")
else:
logger.debug(
- f"{num_lines} lines (max={max_length} chars): one column"
+ f"{num_lines} lines: one column mode"
)
f.write(f"<FONT><UL>{contents}</UL></FONT>")
f.write("</DIV>")