Revert "added rule shorthand, for creating CrawlSpider rules"

This reverts commit r863.

This is not the place for this shorthand, and it hasn't the blessing of
BDFL. I look forward for the return of this shorthand.

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%401023
This commit is contained in:
Daniel Grana 2009-03-27 06:46:06 +00:00
parent 7227b65de1
commit 186d0e93b0
2 changed files with 1 additions and 10 deletions

View File

@ -1,2 +1,2 @@
from scrapy.contrib.spiders.crawl import CrawlSpider, Rule, rule
from scrapy.contrib.spiders.crawl import CrawlSpider, Rule
from scrapy.contrib.spiders.feed import XMLFeedSpider, CSVFeedSpider

View File

@ -10,7 +10,6 @@ import copy
from scrapy.http import Request
from scrapy.spider import BaseSpider
from scrapy.conf import settings
from scrapy.link.extractors import RegexLinkExtractor
class Rule(object):
"""
@ -46,14 +45,6 @@ class Rule(object):
else:
self.follow = follow
def rule(regex, callback=None, exclude=None, follow=None):
"""Shorthand for creating CrawlSpider rules"""
deny = [exclude] if exclude else []
link_extractor = RegexLinkExtractor(allow=[regex], deny=deny)
return Rule(link_extractor, callback=callback, follow=follow)
class CrawlSpider(BaseSpider):
"""
Class for spiders that crawl over web pages and extract/parse their links