]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/bkmk_rsimple_tos.py
Handle HTTP Error 303 redirects
[bookmarks_db.git] / Robots / bkmk_rsimple_tos.py
index 4f8588a3a215c44b02a310b1bcd13f419412cb42..dec1680e72d1f9dd6ec7629119654818a1a93250 100644 (file)
@@ -1,23 +1,28 @@
-"""
-   Simple robot with timeoutsocket
+"""Simple robot with socket's timeout
 
-   Written by BroytMann. Copyright (C) 2000-2007 PhiloSoft Design
+This file is a part of Bookmarks database and Internet robot.
 """
 
+__author__ = "Oleg Broytman <phd@phdru.name>"
+__copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design"
+__license__ = "GNU GPL"
+
+__all__ = ['robot_simple_tos']
+
 
-import socket, timeoutsocket
-timeoutsocket.setDefaultSocketTimeout(900)
+import socket
+socket.setdefaulttimeout(900)
+
+from .bkmk_rsimple import robot_simple, get_error
 
-from bkmk_rsimple import robot_simple, get_error
 
 class robot_simple_tos(robot_simple):
    def check_url(self, bookmark):
       try:
          return robot_simple.check_url(self, bookmark)
-
-      except (socket.error, timeoutsocket.Timeout), msg:
+      except socket.error, msg:
          bookmark.error = get_error(msg)
+         self.log(bookmark.error)
 
       self.finish_check_url(bookmark)
-
       return 1