'
)
- contents = linkify.sub(r'\1', contents)
+ #contents = linkify.sub(r'\1', contents)
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 //= 2
leading_spaces = int(leading_spaces)
x = x.lstrip(" ")
- # self.debug_print(" * (%d) '%s'" % (leading_spaces, x))
+ # logger.debug(" * (%d) '%s'" % (leading_spaces, x))
for y in range(0, leading_spaces):
x = "
" + x
for y in range(0, leading_spaces):
@@ -86,7 +88,7 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
if color in list(self.colors_by_name.keys()):
color = self.colors_by_name[color]
else:
- self.debug_print(f"Unknown color '{color}'")
+ logger.debug(f"Unknown color '{color}'")
print(f"TITLE: {color} {note.title}")
with file_writer.file_writer(filename) as f:
f.write("""
@@ -102,9 +104,9 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
"""
)
- if num_lines >= 12 and max_length < 120:
- self.debug_print(
- f"{num_lines} lines (max={max_length} chars): two columns"
+ if num_lines >= 12:
+ logger.debug(
+ f"{num_lines} lines: two column mode"
)
f.write('
')
f.write(
@@ -123,14 +125,14 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
f.write("