Exemple #1
0
 def _tablet_position_cb(self, instance, x, y, buttons_state):
     SpiceClientGLib.inputs_position(self._inputs_channel, x, y, 0,
                                     buttons_state)
Exemple #2
0
                                lambda a, b: opened_event.set())
        char_device_instance.port_event(SpiceServerGLib.PortEvent.OPENED)
        await opened_event.wait()

        # When
        port_channel.write_async(b"efghi", None,
                                 lambda s, r, u: port_channel.write_finish(r),
                                 None)
        await write_event.wait()

        # Then
        self.assertEqual(b"efghi", written_data.get_data())


# XXX Temporary: patch SpiceClientGLib.PortChannel if method-name fix has not been applied
if not hasattr(SpiceClientGLib.PortChannel, "event"):
    SpiceClientGLib.PortChannel.event = lambda self, a: SpiceClientGLib.port_event(
        self, a)
    SpiceClientGLib.PortChannel.write_async = lambda self, a, b, c, d: SpiceClientGLib.port_write_async(
        self, a, b, c, d)
    SpiceClientGLib.PortChannel.write_finish = lambda self, a: SpiceClientGLib.port_write_finish(
        self, a)
if not hasattr(SpiceClientGLib.InputsChannel, "position"):
    SpiceClientGLib.InputsChannel.position = lambda self, a, b, c, d: SpiceClientGLib.inputs_position(
        self, a, b, c, d)
    SpiceClientGLib.InputsChannel.key_press = lambda self, a: SpiceClientGLib.inputs_key_press(
        self, a)

if __name__ == "__main__":
    unittest.main()