You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
684 B

4 years ago
  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"""
  13. # ISpiderManager is deprecated, don't use it!
  14. # An alias is kept for backwards compatibility.
  15. ISpiderManager = ISpiderLoader