]> git.phdru.name Git - bookmarks_db.git/blob - Robots/bkmk_rsimple_tos.py
25fa88f1d4fe7c514c63bfc0aa3751cc074a3463
[bookmarks_db.git] / Robots / bkmk_rsimple_tos.py
1 """Simple robot with socket's timeout
2
3 This file is a part of Bookmarks database and Internet robot.
4 """
5
6 __version__ = "$Revision$"[11:-2]
7 __revision__ = "$Id$"[5:-2]
8 __date__ = "$Date$"[7:-2]
9 __author__ = "Oleg Broytman <phd@phdru.name>"
10 __copyright__ = "Copyright (C) 2000-2011 PhiloSoft Design"
11 __license__ = "GNU GPL"
12
13 import socket
14 socket.setdefaulttimeout(900)
15
16 from .bkmk_rsimple import robot_simple, get_error
17
18
19 class robot_simple_tos(robot_simple):
20    def check_url(self, bookmark):
21       try:
22          return robot_simple.check_url(self, bookmark)
23       except socket.error, msg:
24          bookmark.error = get_error(msg)
25          self.log(bookmark.error)
26
27       self.finish_check_url(bookmark)
28       return 1