Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
 def __init__(self):
     self.value = None
     signals.connect(FOO_SIGNAL, self.receive)
Beispiel #5
0
 def __init__(self):
     self.value = None
     signals.connect(FOO_SIGNAL, self.receive)