inifinite recursion

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@907 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2003-06-18 07:50:08 +00:00
parent 93463b8b92
commit ec4c6a0c81
4 changed files with 12 additions and 7 deletions

View file

@ -483,8 +483,6 @@ class Configuration (UserDict.UserDict):
except ConfigParser.Error, msg: debug(NIGHTMARE, msg)
try:
num = cfgparser.getint(section, "recursionlevel")
if num<0:
error(i18n._("illegal recursionlevel number %d") % num)
self["recursionlevel"] = num
except ConfigParser.Error, msg: debug(NIGHTMARE, msg)
try:

View file

@ -330,7 +330,8 @@ class UrlData:
return self.valid and \
self.isHtml() and \
not self.cached and \
self.recursionLevel < self.config["recursionlevel"] and \
(self.config["recursionlevel"] >= 0 and
self.recursionLevel < self.config["recursionlevel"]) and \
not self.extern[0]

View file

@ -96,7 +96,8 @@ For single-letter option arguments the space is not a necessity. So
-q, --quiet
Quiet operation. This is only useful with -F.
-r depth, --recursion-level=depth
Check recursively all links up to given depth (depth >= 0).
Check recursively all links up to given depth. A negative depth
will enable inifinite recursion.
Default depth is 1.
-s, --strict
Check only syntax of extern links, do not try to connect to them.
@ -323,11 +324,15 @@ for opt,arg in options:
config["quiet"] = 1
elif opt=="-r" or opt=="--recursion-level":
try:
depth = int(arg)
except ValueError:
printUsage(i18n._("Illegal argument %s for option %s") % \
(`arg`, "'-r, --recursion-level'"))
if int(arg) >= 0:
config["recursionlevel"] = int(arg)
else:
printUsage((i18n._("Illegal argument '%s' for option ") % arg) +
"'-r, --recursion-level'")
config["recursionlevel"] = -1
# robots.txt is now default, so ignore this option
elif opt=="-R" or opt=="--robots-txt": pass

View file

@ -94,7 +94,8 @@ Default is no pause between requests.
Quiet operation. This is only useful with \fB-F\fP.
.TP
\fB-r \fIdepth\fP, \fB--recursion-level=\fIdepth\fP
Check recursively all links up to given \fIdepth\fP (depth >= 0).
Check recursively all links up to given \fIdepth\fP.
A negative depth will enable inifinite recursion.
Default depth is 1.
.TP
\fB-s\fP, \fB--strict\fP