def __init__(self, root, encoding=None): self._encoding = encoding self._root = xml.root(root, encoding) self._markingmap = markingmap.build(self._root, encoding) self._entities = set() # Connect our mixbox signal receiver signals.connect("Entity.created.from_obj", self._handle_entity_created)
def test_static_receiver(self): """Tests that a static method can be registerd as a receiver.""" self.assertEqual(MockReceiver.static_value, None) signals.connect(FOO_SIGNAL, MockReceiver.static_receive) sender = MockSender() sender.send() self.assertEqual(MockReceiver.static_value, FOO_EMIT_VAL)
def __init__(self): self.value = None signals.connect(FOO_SIGNAL, self.receive)