class robot_forking(Robot):
subproc = 'urllib' # Default subprocess
- def check_url(self, bookmark):
+ def check_bookmark(self, bookmark):
global _set_subproc
if _set_subproc:
_set_subproc = False
def version_str(self):
return self.__class__.__name__
- def check_url(self, bookmark):
+ def check_bookmark(self, bookmark):
try:
self.start = int(time.time())
bookmark.icon = None
error, http_status_code, redirect_to, headers, content = \
- self.smart_get(bookmark, bookmark.href, True)
+ self.get_url(bookmark, bookmark.href, True)
if error is not None:
bookmark.error = error
icon_error, \
icon_status_code, icon_redirect_to, \
icon_headers, icon_data = \
- self.smart_get(bookmark, _icon_url)
+ self.get_url(bookmark, _icon_url)
if icon_error:
raise IOError("No icon: " + icon_error)
break
finally:
self.finish_check_url(bookmark)
- def smart_get(self, bookmark, url, accept_charset=False):
+ def get_url(self, bookmark, url, accept_charset=False):
split_results = urlsplit(url)
url_proto = split_results.scheme
url_host = split_results.hostname
bookmark = Bookmark(href=url, add_date=None)
bookmark.parent = None
- robot.check_url(bookmark)
+ robot.check_bookmark(bookmark)
if hasattr(bookmark, 'error'):
print(bookmark.error)
getattr(old_object, attr_name))
else:
log("Checking %s" % href)
- robot.check_url(object)
+ robot.check_bookmark(object)
checked[href] = object_no
urls_no = urls_no + 1
bookmark.parent = None
error, redirect_code, redirect_to, headers, content = \
- robot.smart_get(bookmark, url, True)
+ robot.get_url(bookmark, url, True)
if error:
sys.stderr.write(error + '\n')