From 820cbcdbbdac176b97752d3619d52a5ca76b7bb3 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 3 Oct 2018 14:01:51 +0200 Subject: controller: Depth limit does not work with i>1 No easy way to fix this, so just limit to [0, 1] for now. --- crocoite/controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crocoite/controller.py') diff --git a/crocoite/controller.py b/crocoite/controller.py index 81f0638..ee05b04 100644 --- a/crocoite/controller.py +++ b/crocoite/controller.py @@ -241,12 +241,14 @@ class DepthLimit (RecursionPolicy): """ Limit recursion by depth. - depth==0 means no recursion, depth==1 is the page and outgoing links, … + depth==0 means no recursion, depth==1 is the page and outgoing links """ __slots__ = ('maxdepth') def __init__ (self, maxdepth=0): + if maxdepth < 0 or maxdepth > 1: + raise ValueError ('Unsupported') self.maxdepth = maxdepth def __call__ (self, urls): -- cgit v1.2.3