interfaces.py 558 B

123456789101112131415161718
  1. from zope.interface import Interface
  2. class ISpiderLoader(Interface):
  3. def from_settings(settings):
  4. """Return an instance of the class for the given settings"""
  5. def load(spider_name):
  6. """Return the Spider class for the given spider name. If the spider
  7. name is not found, it must raise a KeyError."""
  8. def list():
  9. """Return a list with the names of all spiders available in the
  10. project"""
  11. def find_by_request(request):
  12. """Return the list of spiders names that can handle the given request"""