]> git.phdru.name Git - bookmarks_db.git/blob - Robots/bkmk_rsimple_tos.py
dec1680e72d1f9dd6ec7629119654818a1a93250
[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 __author__ = "Oleg Broytman <phd@phdru.name>"
7 __copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design"
8 __license__ = "GNU GPL"
9
10 __all__ = ['robot_simple_tos']
11
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