Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-xcffib for openSUSE:Factory checked in at 2023-05-11 12:31:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-xcffib (Old) and /work/SRC/openSUSE:Factory/.python-xcffib.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xcffib" Thu May 11 12:31:34 2023 rev:14 rq:1085981 version:1.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-xcffib/python-xcffib.changes 2023-04-22 21:58:50.780637445 +0200 +++ /work/SRC/openSUSE:Factory/.python-xcffib.new.1533/python-xcffib.changes 2023-05-11 12:31:40.206167539 +0200 @@ -1,0 +2,9 @@ +Wed May 10 06:54:58 UTC 2023 - Dirk Müller <[email protected]> + +- update to 1.3.0: + * remove leftover six import + * module: expose additional xcb errors + * Fix List.to_string() +- drop python-xcffib-six-leftover.patch (upstream) + +------------------------------------------------------------------- Old: ---- python-xcffib-six-leftover.patch xcffib-1.2.0.tar.gz New: ---- xcffib-1.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-xcffib.spec ++++++ --- /var/tmp/diff_new_pack.vn3Slf/_old 2023-05-11 12:31:40.814170527 +0200 +++ /var/tmp/diff_new_pack.vn3Slf/_new 2023-05-11 12:31:40.818170546 +0200 @@ -27,15 +27,13 @@ %{?sle15_python_module_pythons} Name: python-xcffib%{?psuffix} -Version: 1.2.0 +Version: 1.3.0 Release: 0 Summary: A drop in replacement for xpyb, an XCB python binding License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/tych0/xcffib Source: https://files.pythonhosted.org/packages/source/x/xcffib/xcffib-%{version}.tar.gz -# https://github.com/tych0/xcffib/commit/8a488867d30464913706376ca3a9f4c98ca6c5cf -Patch0: python-xcffib-six-leftover.patch # fix ffi import [bsc#1209570c4] Patch1: python-xcffib-ffi-import.patch BuildRequires: %{python_module cffi >= 1.1.0} ++++++ xcffib-1.2.0.tar.gz -> xcffib-1.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/PKG-INFO new/xcffib-1.3.0/PKG-INFO --- old/xcffib-1.2.0/PKG-INFO 2023-01-08 22:26:32.995809300 +0100 +++ new/xcffib-1.3.0/PKG-INFO 2023-04-14 19:30:19.797498000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: xcffib -Version: 1.2.0 +Version: 1.3.0 Summary: A drop in replacement for xpyb, an XCB python binding Home-page: http://github.com/tych0/xcffib Author: Tycho Andersen @@ -11,10 +11,10 @@ Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/README.md new/xcffib-1.3.0/README.md --- old/xcffib-1.2.0/README.md 2023-01-08 16:36:31.000000000 +0100 +++ new/xcffib-1.3.0/README.md 2023-01-08 22:27:05.000000000 +0100 @@ -117,6 +117,5 @@ ## TODO -* XGE support? (xpyb doesn't implement this either) * xprint and xkb support. These will require some non-trivial work in xcb-types, since it won't parse them correctly. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/setup.py new/xcffib-1.3.0/setup.py --- old/xcffib-1.2.0/setup.py 2023-01-08 22:26:22.000000000 +0100 +++ new/xcffib-1.3.0/setup.py 2023-04-14 19:30:16.000000000 +0200 @@ -54,7 +54,7 @@ cffi_modules=["xcffib/ffi_build.py:ffi"] ) -version = "1.2.0" +version = "1.3.0" dependencies = [requires_cffi] setup( @@ -79,10 +79,10 @@ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/test/test_connection.py new/xcffib-1.3.0/test/test_connection.py --- old/xcffib-1.2.0/test/test_connection.py 2023-01-08 22:23:36.000000000 +0100 +++ new/xcffib-1.3.0/test/test_connection.py 2023-04-02 17:30:16.000000000 +0200 @@ -53,8 +53,8 @@ # i.e: # xproto setup query = seqno 0 # xtest setup query = seqno 1 - assert xproto_test.xproto.GetInputFocus().sequence == 6 assert xproto_test.xproto.GetInputFocus().sequence == 7 + assert xproto_test.xproto.GetInputFocus().sequence == 8 def test_discard_sequence(self, xproto_test): cookie = xproto_test.xproto.GetInputFocus() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/test/test_python_code.py new/xcffib-1.3.0/test/test_python_code.py --- old/xcffib-1.2.0/test/test_python_code.py 2023-01-08 22:23:36.000000000 +0100 +++ new/xcffib-1.3.0/test/test_python_code.py 2023-04-02 17:30:16.000000000 +0200 @@ -16,8 +16,8 @@ import xcffib import xcffib.xproto import xcffib.xinput +import xcffib.randr import os -import six import struct import sys from xcffib._ffi import ffi @@ -187,6 +187,20 @@ assert event.root_x >> 16 == 100 assert event.root_y >> 16 == 200 + def test_List_to_string(self, xcffib_test): + xrandr = xcffib_test.conn(xcffib.randr.key) + try: + setup = xcffib_test.conn.get_setup() + for screen in setup.roots: + scrn_rsrcs = xrandr.GetScreenResources(screen.root).reply() + for output in scrn_rsrcs.outputs: + info = xrandr.GetOutputInfo(output, xcffib.XCB_CURRENT_TIME).reply() + print(info.name.to_string()) + assert info.name.to_string() == 'screen' + finally: + xcffib_test.conn.disconnect() + + class TestXcffibTestGenerator: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/__init__.py new/xcffib-1.3.0/xcffib/__init__.py --- old/xcffib-1.2.0/xcffib/__init__.py 2023-01-08 22:26:22.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/__init__.py 2023-04-14 19:30:16.000000000 +0200 @@ -38,7 +38,7 @@ lib = ffi.dlopen(soname) __xcb_proto_version__ = "1.15.2" -__version__ = "1.2.0" +__version__ = "1.3.0" X_PROTOCOL = lib.X_PROTOCOL X_PROTOCOL_REVISION = lib.X_PROTOCOL_REVISION @@ -59,8 +59,8 @@ XCB_CONN_CLOSED_MEM_INSUFFICIENT = lib.XCB_CONN_CLOSED_MEM_INSUFFICIENT XCB_CONN_CLOSED_REQ_LEN_EXCEED = lib.XCB_CONN_CLOSED_REQ_LEN_EXCEED XCB_CONN_CLOSED_PARSE_ERR = lib.XCB_CONN_CLOSED_PARSE_ERR -# XCB_CONN_CLOSED_INVALID_SCREEN = lib.XCB_CONN_CLOSED_INVALID_SCREEN -# XCB_CONN_CLOSED_FDPASSING_FAILED = lib.XCB_CONN_CLOSED_FDPASSING_FAILED +XCB_CONN_CLOSED_INVALID_SCREEN = lib.XCB_CONN_CLOSED_INVALID_SCREEN +XCB_CONN_CLOSED_FDPASSING_FAILED = lib.XCB_CONN_CLOSED_FDPASSING_FAILED cffi_explicit_lifetimes = weakref.WeakKeyDictionary() @@ -456,7 +456,10 @@ """ A helper for converting a List of chars to a native string. Dies if the list contents are not something that could be reasonably converted to a string. """ - return ''.join(chr(i[0]) for i in self) + try: + return ''.join(chr(i[0]) for i in self) + except TypeError: + return ''.join(chr(i) for i in self) def to_utf8(self): return b''.join(self).decode('utf-8') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/glx.py new/xcffib-1.3.0/xcffib/glx.py --- old/xcffib-1.2.0/xcffib/glx.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/glx.py 2023-04-14 19:30:16.000000000 +0200 @@ -1229,6 +1229,7 @@ buf.write(struct.pack("=xx2xIIIII", major_version, minor_version, num_versions, gl_str_len, glx_str_len)) buf.write(xcffib.pack_list(gl_versions, "I")) buf.write(xcffib.pack_list(gl_extension_string, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(glx_extension_string, "c")) return self.send_request(33, buf, is_checked=is_checked) def CreateContextAttribsARB(self, context, fbconfig, screen, share_list, is_direct, num_attribs, attribs, is_checked=False): @@ -1241,6 +1242,7 @@ buf.write(struct.pack("=xx2xIIIII", major_version, minor_version, num_versions, gl_str_len, glx_str_len)) buf.write(xcffib.pack_list(gl_versions, "I")) buf.write(xcffib.pack_list(gl_extension_string, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(glx_extension_string, "c")) return self.send_request(35, buf, is_checked=is_checked) def NewList(self, context_tag, list, mode, is_checked=False): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/randr.py new/xcffib-1.3.0/xcffib/randr.py --- old/xcffib-1.2.0/xcffib/randr.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/randr.py 2023-04-14 19:30:16.000000000 +0200 @@ -391,6 +391,30 @@ ScaleUp = 1 << 1 ScaleDown = 1 << 2 Projective = 1 << 3 +class GetCrtcTransformReply(xcffib.Reply): + xge = False + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Reply.__init__(self, unpacker) + base = unpacker.offset + unpacker.unpack("xx2x4x") + self.pending_transform = render.TRANSFORM(unpacker) + self.has_transforms, = unpacker.unpack("B3x") + unpacker.pad(render.TRANSFORM) + self.current_transform = render.TRANSFORM(unpacker) + self.pending_len, self.pending_nparams, self.current_len, self.current_nparams = unpacker.unpack("4xHHHH") + unpacker.pad("c") + self.pending_filter_name = xcffib.List(unpacker, "c", self.pending_len) + unpacker.pad("i") + self.pending_params = xcffib.List(unpacker, "i", self.pending_nparams) + unpacker.pad("c") + self.current_filter_name = xcffib.List(unpacker, "c", self.current_len) + unpacker.pad("i") + self.current_params = xcffib.List(unpacker, "i", self.current_nparams) + self.bufsize = unpacker.offset - base +class GetCrtcTransformCookie(xcffib.Cookie): + reply_type = GetCrtcTransformReply class GetPanningReply(xcffib.Reply): xge = False def __init__(self, unpacker): @@ -909,12 +933,13 @@ buf.write(struct.pack("=H", filter_len)) buf.write(struct.pack("=2x", )) buf.write(xcffib.pack_list(filter_name, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(filter_params, "i")) return self.send_request(26, buf, is_checked=is_checked) - def GetCrtcTransform(self, crtc, is_checked=False): + def GetCrtcTransform(self, crtc, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xI", crtc)) - return self.send_request(27, buf, is_checked=is_checked) + return self.send_request(27, buf, GetCrtcTransformCookie, is_checked=is_checked) def GetPanning(self, crtc, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xI", crtc)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/render.py new/xcffib-1.3.0/xcffib/render.py --- old/xcffib-1.2.0/xcffib/render.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/render.py 2023-04-14 19:30:16.000000000 +0200 @@ -794,6 +794,7 @@ buf = io.BytesIO() buf.write(struct.pack("=xx2xIH2x", picture, filter_len)) buf.write(xcffib.pack_list(filter, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(values, "i")) return self.send_request(30, buf, is_checked=is_checked) def CreateAnimCursor(self, cid, cursors_len, cursors, is_checked=False): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/sync.py new/xcffib-1.3.0/xcffib/sync.py --- old/xcffib-1.2.0/xcffib/sync.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/sync.py 2023-04-14 19:30:16.000000000 +0200 @@ -65,6 +65,7 @@ buf.write(self.resolution.pack() if hasattr(self.resolution, "pack") else INT64.synthetic(*self.resolution).pack()) buf.write(struct.pack("=H", self.name_len)) buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, counter, resolution, name_len, name): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/xinput.py new/xcffib-1.3.0/xcffib/xinput.py --- old/xcffib-1.2.0/xcffib/xinput.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/xinput.py 2023-04-14 19:30:16.000000000 +0200 @@ -231,6 +231,22 @@ self.len = len self.string = string return self +class ListInputDevicesReply(xcffib.Reply): + xge = False + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Reply.__init__(self, unpacker) + base = unpacker.offset + self.xi_reply_type, self.devices_len = unpacker.unpack("xB2x4xB23x") + self.devices = xcffib.List(unpacker, DeviceInfo, self.devices_len) + unpacker.pad(InputInfo) + self.infos = xcffib.List(unpacker, InputInfo, sum(self.devices)) + unpacker.pad(xproto.STR) + self.names = xcffib.List(unpacker, xproto.STR, self.devices_len) + self.bufsize = unpacker.offset - base +class ListInputDevicesCookie(xcffib.Cookie): + reply_type = ListInputDevicesReply class InputClassInfo(xcffib.Struct): xge = False def __init__(self, unpacker): @@ -251,6 +267,18 @@ self.class_id = class_id self.event_type_base = event_type_base return self +class OpenDeviceReply(xcffib.Reply): + xge = False + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Reply.__init__(self, unpacker) + base = unpacker.offset + self.xi_reply_type, self.num_classes = unpacker.unpack("xB2x4xB23x") + self.class_info = xcffib.List(unpacker, InputClassInfo, self.num_classes) + self.bufsize = unpacker.offset - base +class OpenDeviceCookie(xcffib.Cookie): + reply_type = OpenDeviceReply class SetDeviceModeReply(xcffib.Reply): xge = False def __init__(self, unpacker): @@ -879,6 +907,18 @@ self.bufsize = unpacker.offset - base class SetDeviceModifierMappingCookie(xcffib.Cookie): reply_type = SetDeviceModifierMappingReply +class GetDeviceButtonMappingReply(xcffib.Reply): + xge = False + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Reply.__init__(self, unpacker) + base = unpacker.offset + self.xi_reply_type, self.map_size = unpacker.unpack("xB2x4xB23x") + self.map = xcffib.List(unpacker, "B", self.map_size) + self.bufsize = unpacker.offset - base +class GetDeviceButtonMappingCookie(xcffib.Cookie): + reply_type = GetDeviceButtonMappingReply class SetDeviceButtonMappingReply(xcffib.Reply): xge = False def __init__(self, unpacker): @@ -1456,6 +1496,23 @@ _8Bits = 8 _16Bits = 16 _32Bits = 32 +class GetDevicePropertyReply(xcffib.Reply): + xge = False + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Reply.__init__(self, unpacker) + base = unpacker.offset + self.xi_reply_type, self.type, self.bytes_after, self.num_items, self.format, self.device_id = unpacker.unpack("xB2x4xIIIBB10x") + if self.format & PropertyFormat._8Bits: + self.data8 = xcffib.List(unpacker, "B", self.num_items) + if self.format & PropertyFormat._16Bits: + self.data16 = xcffib.List(unpacker, "H", self.num_items) + if self.format & PropertyFormat._32Bits: + self.data32 = xcffib.List(unpacker, "I", self.num_items) + self.bufsize = unpacker.offset - base +class GetDevicePropertyCookie(xcffib.Cookie): + reply_type = GetDevicePropertyReply class Device: All = 0 AllMaster = 1 @@ -1541,6 +1598,7 @@ buf = io.BytesIO() buf.write(struct.pack("=HHHBB", self.type, self.len, self.name_len, self.send_core, self.enable)) buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, type, len, name_len, send_core, enable, name): @@ -1627,17 +1685,48 @@ xcffib.Struct.__init__(self, unpacker) base = unpacker.offset self.type, self.len = unpacker.unpack("HH") + if self.type == HierarchyChangeType.AddMaster: + self.name_len, self.send_core, self.enable = unpacker.unpack("HBB") + self.name = xcffib.List(unpacker, "c", self.name_len) + if self.type == HierarchyChangeType.RemoveMaster: + self.deviceid, self.return_mode, self.return_pointer, self.return_keyboard = unpacker.unpack("HBxHH") + if self.type == HierarchyChangeType.AttachSlave: + self.deviceid, self.master = unpacker.unpack("HH") + if self.type == HierarchyChangeType.DetachSlave: + self.deviceid, = unpacker.unpack("H2x") self.bufsize = unpacker.offset - base def pack(self): buf = io.BytesIO() buf.write(struct.pack("=HH", self.type, self.len)) + if self.type & HierarchyChangeType.AddMaster: + self.name_len = self.data.pop(0) + self.send_core = self.data.pop(0) + self.enable = self.data.pop(0) + self.name = self.data.pop(0) + self.data.pop(0) + buf.write(struct.pack("=HBB", self.name_len, self.send_core, self.enable)) + buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) + if self.type & HierarchyChangeType.RemoveMaster: + self.deviceid = self.data.pop(0) + self.return_mode = self.data.pop(0) + self.return_pointer = self.data.pop(0) + self.return_keyboard = self.data.pop(0) + buf.write(struct.pack("=HBxHH", self.deviceid, self.return_mode, self.return_pointer, self.return_keyboard)) + if self.type & HierarchyChangeType.AttachSlave: + self.deviceid = self.data.pop(0) + self.master = self.data.pop(0) + buf.write(struct.pack("=HH", self.deviceid, self.master)) + if self.type & HierarchyChangeType.DetachSlave: + self.deviceid = self.data.pop(0) + buf.write(struct.pack("=H2x", self.deviceid)) return buf.getvalue() - fixed_size = 4 @classmethod - def synthetic(cls, type, len): + def synthetic(cls, type, len, data): self = cls.__new__(cls) self.type = type self.len = len + self.data = data return self class XIGetClientPointerReply(xcffib.Reply): xge = False @@ -1996,6 +2085,7 @@ buf = io.BytesIO() buf.write(struct.pack("=HHHHHBx", self.deviceid, self.type, self.attachment, self.num_classes, self.name_len, self.enabled)) buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(self.classes, DeviceClass)) return buf.getvalue() @classmethod @@ -2114,6 +2204,23 @@ self.bufsize = unpacker.offset - base class XIListPropertiesCookie(xcffib.Cookie): reply_type = XIListPropertiesReply +class XIGetPropertyReply(xcffib.Reply): + xge = False + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Reply.__init__(self, unpacker) + base = unpacker.offset + self.type, self.bytes_after, self.num_items, self.format = unpacker.unpack("xx2x4xIIIB11x") + if self.format & PropertyFormat._8Bits: + self.data8 = xcffib.List(unpacker, "B", self.num_items) + if self.format & PropertyFormat._16Bits: + self.data16 = xcffib.List(unpacker, "H", self.num_items) + if self.format & PropertyFormat._32Bits: + self.data32 = xcffib.List(unpacker, "I", self.num_items) + self.bufsize = unpacker.offset - base +class XIGetPropertyCookie(xcffib.Cookie): + reply_type = XIGetPropertyReply class XIGetSelectedEventsReply(xcffib.Reply): xge = False def __init__(self, unpacker): @@ -4267,14 +4374,14 @@ buf.write(struct.pack("=xx2xH2x", name_len)) buf.write(xcffib.pack_list(name, "c")) return self.send_request(1, buf, GetExtensionVersionCookie, is_checked=is_checked) - def ListInputDevices(self, is_checked=False): + def ListInputDevices(self, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2x")) - return self.send_request(2, buf, is_checked=is_checked) - def OpenDevice(self, device_id, is_checked=False): + return self.send_request(2, buf, ListInputDevicesCookie, is_checked=is_checked) + def OpenDevice(self, device_id, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xB3x", device_id)) - return self.send_request(3, buf, is_checked=is_checked) + return self.send_request(3, buf, OpenDeviceCookie, is_checked=is_checked) def CloseDevice(self, device_id, is_checked=False): buf = io.BytesIO() buf.write(struct.pack("=xx2xB3x", device_id)) @@ -4379,10 +4486,10 @@ buf.write(struct.pack("=xx2xBB2x", device_id, keycodes_per_modifier)) buf.write(xcffib.pack_list(keymaps, "B")) return self.send_request(27, buf, SetDeviceModifierMappingCookie, is_checked=is_checked) - def GetDeviceButtonMapping(self, device_id, is_checked=False): + def GetDeviceButtonMapping(self, device_id, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xB3x", device_id)) - return self.send_request(28, buf, is_checked=is_checked) + return self.send_request(28, buf, GetDeviceButtonMappingCookie, is_checked=is_checked) def SetDeviceButtonMapping(self, device_id, map_size, map, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xBB2x", device_id, map_size)) @@ -4414,18 +4521,31 @@ buf = io.BytesIO() buf.write(struct.pack("=xx2xB3x", device_id)) return self.send_request(36, buf, ListDevicePropertiesCookie, is_checked=is_checked) - def ChangeDeviceProperty(self, property, type, device_id, format, mode, num_items, is_checked=False): + def ChangeDeviceProperty(self, property, type, device_id, format, mode, num_items, items, is_checked=False): buf = io.BytesIO() buf.write(struct.pack("=xx2xIIBBBxI", property, type, device_id, format, mode, num_items)) + if format & PropertyFormat._8Bits: + data8 = items.pop(0) + items.pop(0) + buf.write(xcffib.pack_list(data8, "B")) + buf.write(struct.pack("=4x", )) + if format & PropertyFormat._16Bits: + data16 = items.pop(0) + items.pop(0) + buf.write(xcffib.pack_list(data16, "H")) + buf.write(struct.pack("=4x", )) + if format & PropertyFormat._32Bits: + data32 = items.pop(0) + buf.write(xcffib.pack_list(data32, "I")) return self.send_request(37, buf, is_checked=is_checked) def DeleteDeviceProperty(self, property, device_id, is_checked=False): buf = io.BytesIO() buf.write(struct.pack("=xx2xIB3x", property, device_id)) return self.send_request(38, buf, is_checked=is_checked) - def GetDeviceProperty(self, property, type, offset, len, device_id, delete, is_checked=False): + def GetDeviceProperty(self, property, type, offset, len, device_id, delete, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xIIIIBB2x", property, type, offset, len, device_id, delete)) - return self.send_request(39, buf, is_checked=is_checked) + return self.send_request(39, buf, GetDevicePropertyCookie, is_checked=is_checked) def XIQueryPointer(self, window, deviceid, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xIH2x", window, deviceid)) @@ -4500,18 +4620,31 @@ buf = io.BytesIO() buf.write(struct.pack("=xx2xH2x", deviceid)) return self.send_request(56, buf, XIListPropertiesCookie, is_checked=is_checked) - def XIChangeProperty(self, deviceid, mode, format, property, type, num_items, is_checked=False): + def XIChangeProperty(self, deviceid, mode, format, property, type, num_items, items, is_checked=False): buf = io.BytesIO() buf.write(struct.pack("=xx2xHBBIII", deviceid, mode, format, property, type, num_items)) + if format & PropertyFormat._8Bits: + data8 = items.pop(0) + items.pop(0) + buf.write(xcffib.pack_list(data8, "B")) + buf.write(struct.pack("=4x", )) + if format & PropertyFormat._16Bits: + data16 = items.pop(0) + items.pop(0) + buf.write(xcffib.pack_list(data16, "H")) + buf.write(struct.pack("=4x", )) + if format & PropertyFormat._32Bits: + data32 = items.pop(0) + buf.write(xcffib.pack_list(data32, "I")) return self.send_request(57, buf, is_checked=is_checked) def XIDeleteProperty(self, deviceid, property, is_checked=False): buf = io.BytesIO() buf.write(struct.pack("=xx2xH2xI", deviceid, property)) return self.send_request(58, buf, is_checked=is_checked) - def XIGetProperty(self, deviceid, delete, property, type, offset, len, is_checked=False): + def XIGetProperty(self, deviceid, delete, property, type, offset, len, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xHBxIIII", deviceid, delete, property, type, offset, len)) - return self.send_request(59, buf, is_checked=is_checked) + return self.send_request(59, buf, XIGetPropertyCookie, is_checked=is_checked) def XIGetSelectedEvents(self, window, is_checked=True): buf = io.BytesIO() buf.write(struct.pack("=xx2xI", window)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/xproto.py new/xcffib-1.3.0/xcffib/xproto.py --- old/xcffib-1.2.0/xcffib/xproto.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/xproto.py 2023-04-14 19:30:16.000000000 +0200 @@ -247,7 +247,9 @@ buf = io.BytesIO() buf.write(struct.pack("=BxHHHH2x", self.byte_order, self.protocol_major_version, self.protocol_minor_version, self.authorization_protocol_name_len, self.authorization_protocol_data_len)) buf.write(xcffib.pack_list(self.authorization_protocol_name, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(self.authorization_protocol_data, "c")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, byte_order, protocol_major_version, protocol_minor_version, authorization_protocol_name_len, authorization_protocol_data_len, authorization_protocol_name, authorization_protocol_data): @@ -328,6 +330,7 @@ buf = io.BytesIO() buf.write(struct.pack("=BxHHHIIIIHHBBBBBBBB4x", self.status, self.protocol_major_version, self.protocol_minor_version, self.length, self.release_number, self.resource_id_base, self.resource_id_mask, self.motion_buffer_size, self.vendor_len, self.maximum_request_length, self.roots_len, self.pixmap_formats_len, self.image_byte_order, self.bitmap_format_bit_order, self.bitmap_format_scanline_unit, self.bitmap_format_scanline_pad, self.min_keycode, self.max_keycode)) buf.write(xcffib.pack_list(self.vendor, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(self.pixmap_formats, FORMAT)) buf.write(xcffib.pack_list(self.roots, SCREEN)) return buf.getvalue() @@ -2545,6 +2548,7 @@ buf = io.BytesIO() buf.write(struct.pack("=BxH", self.family, self.address_len)) buf.write(xcffib.pack_list(self.address, "B")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, family, address_len, address): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/xselinux.py new/xcffib-1.3.0/xcffib/xselinux.py --- old/xcffib-1.2.0/xcffib/xselinux.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/xselinux.py 2023-04-14 19:30:16.000000000 +0200 @@ -82,7 +82,9 @@ buf = io.BytesIO() buf.write(struct.pack("=III", self.name, self.object_context_len, self.data_context_len)) buf.write(xcffib.pack_list(self.object_context, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(self.data_context, "c")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, name, object_context_len, data_context_len, object_context, data_context): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib/xv.py new/xcffib-1.3.0/xcffib/xv.py --- old/xcffib-1.2.0/xcffib/xv.py 2023-01-08 22:26:21.000000000 +0100 +++ new/xcffib-1.3.0/xcffib/xv.py 2023-04-14 19:30:16.000000000 +0200 @@ -95,6 +95,7 @@ buf = io.BytesIO() buf.write(struct.pack("=IHHHBx", self.base_id, self.name_size, self.num_ports, self.num_formats, self.type)) buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) buf.write(xcffib.pack_list(self.formats, Format)) return buf.getvalue() @classmethod @@ -125,6 +126,7 @@ buf.write(struct.pack("=IHHH2x", self.encoding, self.name_size, self.width, self.height)) buf.write(self.rate.pack() if hasattr(self.rate, "pack") else Rational.synthetic(*self.rate).pack()) buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, encoding, name_size, width, height, rate, name): @@ -183,6 +185,7 @@ buf = io.BytesIO() buf.write(struct.pack("=IiiI", self.flags, self.min, self.max, self.size)) buf.write(xcffib.pack_list(self.name, "c")) + buf.write(struct.pack("=4x", )) return buf.getvalue() @classmethod def synthetic(cls, flags, min, max, size, name): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.2.0/xcffib.egg-info/PKG-INFO new/xcffib-1.3.0/xcffib.egg-info/PKG-INFO --- old/xcffib-1.2.0/xcffib.egg-info/PKG-INFO 2023-01-08 22:26:32.000000000 +0100 +++ new/xcffib-1.3.0/xcffib.egg-info/PKG-INFO 2023-04-14 19:30:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: xcffib -Version: 1.2.0 +Version: 1.3.0 Summary: A drop in replacement for xpyb, an XCB python binding Home-page: http://github.com/tych0/xcffib Author: Tycho Andersen @@ -11,10 +11,10 @@ Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries
