X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_rsimple.py;h=6b61908b8377428df8dd87e987de7f960534f7f3;hb=f6c34e14a430301c1a4e8f3d9f3db9ec9cf55ec3;hp=8bfa4298299f0c3b9842cdc0fa071b361ed8cd48;hpb=832eb757ef7f81abf1e431ce16f368c10dd57962;p=bookmarks_db.git diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 8bfa429..6b61908 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -3,13 +3,13 @@ This file is a part of Bookmarks database and Internet robot. """ -__version__ = "$Revision$"[11:-2] -__revision__ = "$Id$"[5:-2] -__date__ = "$Date$"[7:-2] __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2000-2011 PhiloSoft Design" +__copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design" __license__ = "GNU GPL" +__all__ = ['robot_simple', 'get_error'] + + import sys, os import time, urllib from base64 import b64encode @@ -193,9 +193,9 @@ class robot_simple(Robot): if icons[icon]: bookmark.icon_href = icon content_type, bookmark.icon = icons[icon] - self.log(" cached icon: %s" % content_type) + self.log(" cached icon: %s" % content_type) else: - self.log(" cached icon: no icon") + self.log(" cached icon: no icon") else: try: _icon = icon @@ -204,7 +204,7 @@ class robot_simple(Robot): icon_fname, headers = urllib.urlretrieve(_icon) except RedirectException, e: _icon = e.url - self.log(" redirect to : %s" % _icon) + self.log(" redirect to : %s" % _icon) else: break else: @@ -226,7 +226,7 @@ class robot_simple(Robot): self.log(" got icon : %s" % content_type) if content_type.startswith("application/") \ or content_type.startswith("text/plain"): - self.log(" non-image content type, assume x-icon") + self.log(" non-image content type, assume x-icon") content_type = 'image/x-icon' bookmark.icon = "data:%s;base64,%s" % (content_type, b64encode(icon_data)) icons[icon] = (content_type, bookmark.icon) @@ -285,7 +285,6 @@ class robot_simple(Robot): # Tested return 1 - def finish_check_url(self, bookmark, fname=None): # Calculate these attributes even in case of an error if fname and os.path.exists(fname):