(self, response)
return -1
Calculate the depth of response, and call corresponding method or stop
        crawl.
Calculate the depth of response, and call corresponding method or stop
        crawl.
Calculate the depth of response and call corresponding method or stop crawl .
def _cal_depth(self, response):
        """
        Calculate the depth of response, and call corresponding method or stop
        crawl.
        """
        url = response.url
        for depth, depth_regexp in enumerate(self.depth_class_list):
            if re.match(depth_regexp, url):
                return depth
        # warn("Unknown url depth: " + url)
        # If the url pattern is unknown, then return -1.
        return -1
def _cal_depth ( self , response ) : url = response . url for depth , depth_regexp in enumerate ( self . depth_class_list ) : if re . match ( depth_regexp , url ) : return depth # warn("Unknown url depth: " + url) # If the url pattern is unknown, then return -1. return - 1