Fix gkeep renderer's f-strings.
authorScott Gasch <[email protected]>
Mon, 11 Jan 2021 23:06:11 +0000 (15:06 -0800)
committerScott Gasch <[email protected]>
Mon, 11 Jan 2021 23:06:11 +0000 (15:06 -0800)
gkeep_renderer.py

index f7bbf7d9c8a2acec645c339a87966b5e869c7072..79ea4c7f602111d076ca5e872250fbc4ec419b18 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
 
 import gkeepapi
 import os
@@ -87,17 +87,21 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
                     color = self.colors_by_name[color]
                 else:
                     self.debug_print(f"Unknown color '{color}'")
+                print(f"TITLE: {color} {note.title}")
                 with file_writer.file_writer(filename) as f:
-                    f.write(
-                        f"""
+                    f.write("""
 <STYLE type="text/css">
   a:link { color:#88bfbf; }
   ul { list-style-type:none; }
 </STYLE>
-<DIV STYLE="border-radius: 25px; border-style: solid; padding: 20px; background-color: {color}; color: #eeeeee; font-size: x-large;">
-<p style="color: #ffffff; font-size:larger"><B>{note.title}</B></p>
-<HR style="border-top: 3px solid white;">"""
-                    )
+<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 >= 12 and max_length < 120:
                         self.debug_print(
                             f"{num_lines} lines (max={max_length} chars): two columns"
@@ -135,5 +139,5 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
 
 
 # Test
-# x = gkeep_renderer({"Test", 1234})
-# x.periodic_render("Test")
+#x = gkeep_renderer({"Test", 1234})
+#x.periodic_render("Test")