MCPcopy
hub / github.com/scrapy/scrapy / connect

Method connect

scrapy/signalmanager.py:18–33  ·  view source on GitHub ↗

Connect a receiver function to a signal. The signal can be any object, although Scrapy comes with some predefined signals that are documented in the :ref:`topics-signals` section. :param receiver: the function to be connected :type receiver: collect

(self, receiver: Any, signal: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

16 self.sender: Any = sender
17
18 def connect(self, receiver: Any, signal: Any, **kwargs: Any) -> None:
19 """
20 Connect a receiver function to a signal.
21
22 The signal can be any object, although Scrapy comes with some
23 predefined signals that are documented in the :ref:`topics-signals`
24 section.
25
26 :param receiver: the function to be connected
27 :type receiver: collections.abc.Callable
28
29 :param signal: the signal to connect to
30 :type signal: object
31 """
32 kwargs.setdefault("sender", self.sender)
33 dispatcher.connect(receiver, signal, **kwargs)
34
35 def disconnect(self, receiver: Any, signal: Any, **kwargs: Any) -> None:
36 """

Callers 15

wait_forMethod · 0.95
_testMethod · 0.45
_create_crawlerMethod · 0.45
_test_spiderMethod · 0.45
__init__Method · 0.45
from_crawlerMethod · 0.45
from_crawlerMethod · 0.45
test_scheduler_emptyMethod · 0.45
test_simple_pipelineMethod · 0.45
test_send_catch_logMethod · 0.45

Calls 1

setdefaultMethod · 0.45

Tested by 15

_testMethod · 0.36
_create_crawlerMethod · 0.36
_test_spiderMethod · 0.36
__init__Method · 0.36
test_scheduler_emptyMethod · 0.36
test_simple_pipelineMethod · 0.36
test_send_catch_logMethod · 0.36
clientMethod · 0.36