The changes necessary to upgrade the kiosk to use python3.7.
[kiosk.git] / gkeep_renderer.py
index c882526409d1f9a698385c53c642c931b7d717bb..0285cf13fa70b64af3e2eda480013195014e237e 100644 (file)
@@ -37,7 +37,7 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
         return "gkeep"
 
     def periodic_render(self, key):
-        strikethrough = re.compile(u'\u2611([^\n]*)\n', re.UNICODE)
+        strikethrough = re.compile('\u2611([^\n]*)\n', re.UNICODE)
         linkify = re.compile(r'.*(https?:\/\/\S+).*')
 
         self.keep.sync()
@@ -52,7 +52,7 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
             self.debug_print("Note title '%s'" % title)
             if contents != '' and not contents.isspace():
                 contents = strikethrough.sub(r'<font color="#999999">` <del>\1</del></font>\n', contents)
-                contents = contents.replace('`', u'\u2611')
+                contents = contents.replace('`', '\u2611')
                 #self.debug_print("Note contents:\n%s" % contents)
                 contents = linkify.sub(r'<a href="\1">\1</a>', contents)
                 individual_lines = contents.split("\n")
@@ -64,7 +64,7 @@ class gkeep_renderer(renderer.debuggable_abstaining_renderer):
                         max_length = length
                 contents = contents.replace("\n", "<BR>\n")
                 color = note.color.name.lower()
-                if color in self.colors_by_name.keys():
+                if color in list(self.colors_by_name.keys()):
                     color = self.colors_by_name[color]
                 else:
                     self.debug_print("Unknown color '%s'" % color)