From fb319b37856c747570b79767cfe206c9ce382934 Mon Sep 17 00:00:00 2001 From: calvin Date: Tue, 16 May 2006 23:19:18 +0000 Subject: [PATCH] add callback after robots.txt parse git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3225 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/cache/robots_txt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linkcheck/cache/robots_txt.py b/linkcheck/cache/robots_txt.py index 88248a67..310585c0 100644 --- a/linkcheck/cache/robots_txt.py +++ b/linkcheck/cache/robots_txt.py @@ -37,7 +37,7 @@ class RobotsTxt (object): self.cache = {} @synchronized(_lock) - def allows_url (self, roboturl, url, user, password): + def allows_url (self, roboturl, url, user, password, callback=None): """ Ask robots.txt allowance. """ @@ -46,6 +46,8 @@ class RobotsTxt (object): user=user, password=password) rp.set_url(roboturl) rp.read() + if callback is not None: + callback(rp) self.cache[roboturl] = rp else: rp = self.cache[roboturl]