Connect the signals within the `Flow`.
        The `Flow` is responsible for catching the important signals raised from its works.
329124
def connect_signals(self):
        
        # Connect the signals inside each Work.
        for work in self:
            work.connect_signals()

        # Observe the nodes that must reach S_OK in order to call the callbacks.
        for cbk in self._callbacks:
            #cbk.enable()
            for dep in cbk.deps:
                logger.info("connecting %s \nwith sender %s, signal %s" % (str(cbk), dep.node, dep.node.S_OK))
                dispatcher.connect(self.on_dep_ok, signal=dep.node.S_OK, sender=dep.node, weak=False)
392383
def __autoconnect_signals(self):
        """"""
        dic = {}
        for name in dir(self):
            method = getattr(self, name)
            if (not isinstance(method, collections.Callable)):
                continue
            assert(name not in dic) # not already connected!
            dic[name] = method

        # autoconnects glade in the view (if available any)
        for xml in self.view.glade_xmlWidgets:
            xml.signal_autoconnect(dic)

        # autoconnects builder if available
        if self.view._builder is not None:
            self.view._builder_connect_signals(dic)
828679
def setup_prjs_signals(self, ):
        
        log.debug("Setting up projects page signals.")
        self.prjs_prj_view_pb.clicked.connect(self.prjs_view_prj)
        self.prjs_prj_create_pb.clicked.connect(self.prjs_create_prj)
461343
def setup_signals():
	
	signal.signal(signal.SIGINT, shutit_util.ctrl_c_signal_handler)
	signal.signal(signal.SIGQUIT, shutit_util.ctrl_quit_signal_handler)
776770
def connect(self, signal, slot):
        
        super(XViewDispatch, self).connect(self, SIGNAL(signal), slot)
1337654
def add_signal_handlers(self):
        """"""
        try:
            self.loop.add_signal_handler(signal.SIGHUP, self.SIGHUP)
        except (RuntimeError, AttributeError):  # pragma: no cover
            # windows
            pass
        try:
            self.loop.add_signal_handler(signal.SIGINT, self.SIGINT)
        except (RuntimeError, NotImplementedError):  # pragma: no cover
            # annaconda
            pass
379389
def handle_data(self, data):
        '''  '''
        self.days += 1
        signals = {}
        self.orderbook = {}

        # Everytime but the first tick
        if self.initialized and self.manager:
            # Keep the portfolio aware of the situation
            self.manager.update(
                self.portfolio,
                self.datetime,
                self.perf_tracker.cumulative_risk_metrics.to_dict())
        else:
            # Perf_tracker needs at least a turn to have an index
            self.sids = data.keys()
            self.warm(data)
            self.initialized = True
            return

        try:
            signals = self.event(data)
        except Exception, error:
            # NOTE Temporary debug. Will probably notify the error and go on
            # with signals={}
            raise AlgorithmEventFailed(
                reason=error, date=self.datetime, data=data)

        # One can process orders within the alogrithm and don't return anything
        if signals and self.manager:
            if (signals.get('buy') or signals.get('sell')):
                self.orderbook = self.manager.trade_signals_handler(signals)
                if self.auto and self._is_interactive():
                    self.process_orders(self.orderbook)

        # Some middlewares send stuff over the wires. This little security
        # prevent us from performing a DDOS
        if self._is_interactive():
            self._call_middlewares()
1008016
def maybe_send_signal(self, signum, include_pgrp=True):
    
    remote_pid = self._maybe_last_pid()
    if remote_pid is not None:
      safe_kill(remote_pid, signum)
    if include_pgrp:
      remote_pgrp = self._maybe_last_pgrp()
      if remote_pgrp:
        safe_kill(remote_pgrp, signum)
644598
def connect(self, signalName, slot):
        
        assert signalName in self, "%s is not a registered signal" % signalName
        self[signalName].connect(slot)
1016281
def connect_entry_signals():
    
    post_save.connect(
        ping_directories_handler, sender=Entry,
        dispatch_uid=ENTRY_PS_PING_DIRECTORIES)
    post_save.connect(
        ping_external_urls_handler, sender=Entry,
        dispatch_uid=ENTRY_PS_PING_EXTERNAL_URLS)
    post_save.connect(
        flush_similar_cache_handler, sender=Entry,
        dispatch_uid=ENTRY_PS_FLUSH_SIMILAR_CACHE)
    post_delete.connect(
        flush_similar_cache_handler, sender=Entry,
        dispatch_uid=ENTRY_PD_FLUSH_SIMILAR_CACHE)
1328932
def _install_signal_handlers(self):
        
        def request_stop(signum, frame):
            self._stop_requested = True
            self.log.info('stop requested, waiting for task to finish')
        signal.signal(signal.SIGINT, request_stop)
        signal.signal(signal.SIGTERM, request_stop)
140402
def _connect(self):
        
        if not self.connected.is_set():
            try:
                self.lock.acquire()
                # Another thread may have connected while we were
                # waiting to acquire the lock
                if not self.connected.is_set():
                    self._do_connect()
                    if self.keepalive:
                        self._transport.set_keepalive(self.keepalive)
                    self.connected.set()
            except GerritError:
                raise
            finally:
                self.lock.release()
1153554
def connect_input(self, name, wire):
        """"""
        self._inputs[name] = wire
        wire.sinks.append(self)
1362765
def _recv_flow(self, method_frame):
        '''
        
        '''
        self.channel._active = method_frame.args.read_bit()

        args = Writer()
        args.write_bit(self.channel.active)
        self.send_frame(MethodFrame(self.channel_id, 20, 21, args))

        if self._flow_control_cb is not None:
            self._flow_control_cb()
1342818
def _signal_handler_init(self):
        """"""
        signal.signal(signal.SIGINT, signal.SIG_IGN)
        signal.signal(signal.SIGINT, self._signal_handler)
        signal.signal(signal.SIGTERM, self._signal_handler)
265037
def dispatch():
        
        aliases = SignalDispatcher.signals.keys()

        for alias in aliases:
            handlers = SignalDispatcher.handlers.get(alias)
            signal = SignalDispatcher.signals.get(alias)

            if signal is None or handlers.__len__() == 0:
                continue

            for handler in handlers:
                signal.connect(handler)
167424
def setup_asset_signals(self, ):
        
        log.debug("Setting up asset signals.")
        self.asset_asset_view_pb.clicked.connect(self.asset_view_asset)
        self.asset_asset_create_pb.clicked.connect(self.asset_create_asset)
        self.asset_asset_add_pb.clicked.connect(self.asset_add_asset)
        self.asset_asset_remove_pb.clicked.connect(self.asset_remove_asset)
        self.asset_task_view_pb.clicked.connect(self.asset_view_task)
        self.asset_task_create_pb.clicked.connect(self.asset_create_task)
        self.asset_desc_pte.textChanged.connect(self.asset_save)