]> git.phdru.name Git - bookmarks_db.git/commitdiff
Store only images as icons; do not store text/html errorrs.
authorOleg Broytman <phd@phdru.name>
Sat, 13 Oct 2007 09:02:12 +0000 (09:02 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 13 Oct 2007 09:02:12 +0000 (09:02 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@92 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/bkmk_rsimple.py

index 1c4795c11d6aecb8bfc6a460a260be5b56a65d8b..63c0b4c173b120e13195185ac58450f12d48cec6 100644 (file)
@@ -181,7 +181,10 @@ class robot_simple(Robot):
                         icon_file.close()
                         os.remove(fname)
                         content_type = headers["Content-Type"]
-                        bookmark.icon = "data:%s;base64,%s" % (content_type, b64encode(icon))
+                        if content_type.startswith("image/"):
+                           bookmark.icon = "data:%s;base64,%s" % (content_type, b64encode(icon))
+                        else:
+                           bookmark.icon = None
 
                except KeyError:
                   pass