X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_rurllib_to.py;fp=Robots%2Fbkmk_rurllib_to.py;h=2726dbfc3df1d6d5c829e50a41dd780afd7e56c2;hb=36953325e47aa4de9d3a40e634626108366f4e9c;hp=0000000000000000000000000000000000000000;hpb=8fedded7827ae1d79b31ec38d8e3146bb1a7bea1;p=bookmarks_db.git diff --git a/Robots/bkmk_rurllib_to.py b/Robots/bkmk_rurllib_to.py new file mode 100644 index 0000000..2726dbf --- /dev/null +++ b/Robots/bkmk_rurllib_to.py @@ -0,0 +1,28 @@ +"""Simple robot with socket's timeout + +This file is a part of Bookmarks database and Internet robot. + +""" + +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2000-2014 PhiloSoft Design" +__license__ = "GNU GPL" + +__all__ = ['robot_urllib_to'] + + +import socket +socket.setdefaulttimeout(900) + +from .bkmk_rurllib import robot_urllib, get_error + + +class robot_urllib_to(robot_urllib): + def check_url(self, bookmark): + try: + return robot_urllib.check_url(self, bookmark) + except socket.error, msg: + bookmark.error = get_error(msg) + self.log(bookmark.error) + + return 1