]> git.phdru.name Git - bookmarks_db.git/commitdiff
Get favicon before HTML redirect (refresh).
authorOleg Broytman <phd@phdru.name>
Sun, 2 Jan 2011 23:56:53 +0000 (23:56 +0000)
committerOleg Broytman <phd@phdru.name>
Sun, 2 Jan 2011 23:56:53 +0000 (23:56 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@303 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/bkmk_rsimple.py
doc/ANNOUNCE

index 63f96027c2f5d2458b22d697c6aad34797ce90ff..41fa2b33a607fe1db2e1a322520d47abd2cb6d46 100644 (file)
@@ -176,24 +176,6 @@ class robot_simple(Robot):
                   parser = parse_html(fname, charset, self.log)
                   if parser:
                       bookmark.real_title = parser.title
-                      if parser.refresh:
-                         refresh = parser.refresh
-                         try:
-                            url = refresh.split('=', 1)[1]
-                         except IndexError:
-                            url = "self"
-                         try:
-                            timeout = float(refresh.split(';')[0])
-                         except (IndexError, ValueError):
-                            raise RedirectException("html", "Bad redirect to %s (%s)" % (url, refresh))
-                         else:
-                            try:
-                               timeout = int(refresh.split(';')[0])
-                            except ValueError:
-                               pass # float timeout
-                            raise RedirectException("html", "%s (%s sec)" % (url, timeout))
-
-                      # Get favicon.ico
                       icon = parser.icon
                   else:
                      icon = None
@@ -241,6 +223,22 @@ class robot_simple(Robot):
                         else:
                            self.log("   no icon        : bad content type '%s'" % content_type)
                            icons[icon] = None
+                  if parser and parser.refresh:
+                     refresh = parser.refresh
+                     try:
+                        url = refresh.split('=', 1)[1]
+                     except IndexError:
+                        url = "self"
+                     try:
+                        timeout = float(refresh.split(';')[0])
+                     except (IndexError, ValueError):
+                        raise RedirectException("html", "Bad redirect to %s (%s)" % (url, refresh))
+                     else:
+                        try:
+                           timeout = int(refresh.split(';')[0])
+                        except ValueError:
+                           pass # float timeout
+                        raise RedirectException("html", "%s (%s sec)" % (url, timeout))
 
             except KeyError, key:
                self.log("   no header: %s" % key)
index 8cb06ebd89f7e1dd828f2845cb176c0b604f7c8c..15efd76fbe2a40a7a81b995b3333d0af36654c3f 100644 (file)
@@ -5,11 +5,16 @@ WHAT IS IT
    A set of classes, libraries, programs and plugins I use to manipulate my
 bookmarks.html.
 
+WHAT'S NEW in version 4.3.1 (2011-??-??).
+
+Get favicon before HTML redirect (refresh).
+
+
 WHAT'S NEW in version 4.3.0 (2011-01-01).
 
 Robots no longer have one global temporary file - there are at least two
 (html and favicon), and in the future there will be more for
-asynchronous robot(s) that would test many URLs in parallel.
+asynchronous robot(s) that will test many URLs in parallel.
 
 
 WHERE TO GET