diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2018-10-03 14:01:51 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-10-03 14:01:51 +0200 |
commit | 820cbcdbbdac176b97752d3619d52a5ca76b7bb3 (patch) | |
tree | 251628453fb0ad4b4a902f09160f46ef7b76c965 /crocoite | |
parent | 1231e9066a3fcf49bcaa6499e2407ff879d14227 (diff) | |
download | crocoite-820cbcdbbdac176b97752d3619d52a5ca76b7bb3.tar.gz crocoite-820cbcdbbdac176b97752d3619d52a5ca76b7bb3.tar.bz2 crocoite-820cbcdbbdac176b97752d3619d52a5ca76b7bb3.zip |
controller: Depth limit does not work with i>1
No easy way to fix this, so just limit to [0, 1] for now.
Diffstat (limited to 'crocoite')
-rw-r--r-- | crocoite/controller.py | 4 |
1 files changed, 3 insertions, 1 deletions
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): |