Пример #1
0
    def allow(self, line, handle, item, port=None):
        """
        Glue line's handle to an item.

        If port is not provided, then first port is used.
        """
        if port is None and len(item.ports()) > 0:
            port = item.ports()[0]

        adapter = IConnect(item, line)
        return adapter.allow(handle, port)
Пример #2
0
 def allow(self, sink):
     adapter = IConnect(sink.item, self.item)
     return adapter and adapter.allow(self.handle, sink.port)