Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / proto /
xcb-proto
Commits:
2b3559c1 by Uli Schlachter at 2020-03-21T11:12:52+01:00
Parse a field's "enum=" correctly
In xv.xml, there is something like this:
<struct name="ImageFormatInfo">
[...]
<field type="CARD8" name="byte_order"
enum="ImageOrder" />
<pad bytes="2" />
<list type="CARD8" name="guid">
<value>16</value>
</list>
[...]
</struct>
When parsing this, the Field instance for "guid" ended up with .enum
==
"ImageOrder". This is because the loop that parses complex type did
not
unset a variable across iterations, meaning that the last "enum"
property "stuck" and was also used for all following fields.
Fix this by simply moving the initialisation of the "enum" variable
inside of the loop.
Signed-off-by: Uli Schlachter <[email protected]>
- - - - -
426ae35b by Björn Esser at 2020-06-01T12:40:34+02:00
xcbgen: Use math.gcd() for Python >= 3.5.
fractions.gcd() has been deprecated since Python 3.5, and
was finally dropped in Python 3.9. It is recommended to
use math.gcd() instead.
Signed-off-by: Björn Esser <[email protected]>
- - - - -
7d58eed9 by Björn Esser at 2020-06-01T12:40:34+02:00
xcbgen: xml.etree.cElementTree has been dropped in Python 3.9.
It can be replaced with xml.etree.ElementTree safely.
Signed-off-by: Björn Esser <[email protected]>
- - - - -
029d5b5d by Björn Esser at 2020-06-04T21:08:08+02:00
xcbgen: Use xml.etree.ElementTree for Python >= 3.3.
In commit 7d58eed95f796fc764741d7549ee2214bbbcc64c we started
to use xml.etree.ElementTree for Python >= 3.9. In fact the
xml.etree.cElementTree module has already been deprecated
since Python 3.3.
Given this fact, we should start to use the xml.etree.ElementTree
module beginning with Python 3.3.
See:
https://github.com/python/cpython/commit/a72a98f24a19928e31dcc4cab2cd2ad0f1846e11
Signed-off-by: Björn Esser <[email protected]>
- - - - -
0c31b8a2 by Samanta Navarro at 2020-10-03T11:38:13+00:00
Fix typo in documentation
Signed-off-by: Samanta Navarro <[email protected]>
- - - - -
496e3ce3 by Alan Coopersmith at 2020-10-08T15:29:51-07:00
xcb-proto 1.14.1
Signed-off-by: Alan Coopersmith <[email protected]>
- - - - -
7 changed files:
- NEWS
- configure.ac
- src/xproto.xml
- xcbgen/align.py
- xcbgen/matcher.py
- xcbgen/state.py
- xcbgen/xtypes.py
Changes:
=====================================
NEWS
=====================================
@@ -1,3 +1,8 @@
+Release 1.14.1 (2020-10-08)
+===========================
+* Python 3.9 compatibility (stop using removed interfaces)
+* Fix handling of enum attributes in fields
+
Release 1.14 (2020-02-22)
=========================
* Fix size computation of imported lists
=====================================
configure.ac
=====================================
@@ -3,7 +3,7 @@
AC_PREREQ(2.57)
AC_INIT([XCB Proto],
- 1.14,
+ 1.14.1,
[[email protected]])
AC_CONFIG_SRCDIR([xcb-proto.pc.in])
AM_INIT_AUTOMAKE([foreign dist-xz])
=====================================
src/xproto.xml
=====================================
@@ -2624,7 +2624,7 @@ void my_example(xcb_connection_t *conn, xcb_screen_t
*screen, xcb_cursor_t curso
if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL))) {
if (reply->status == XCB_GRAB_STATUS_SUCCESS)
printf("successfully grabbed the pointer\\n");
- free(preply);
+ free(reply);
}
}
]]></example>
=====================================
xcbgen/align.py
=====================================
@@ -2,7 +2,12 @@
This module contains helper classes for alignment arithmetic and checks
'''
-from fractions import gcd
+from sys import version_info
+
+if version_info[:2] >= (3, 5):
+ from math import gcd
+else:
+ from fractions import gcd
class Alignment(object):
=====================================
xcbgen/matcher.py
=====================================
@@ -7,7 +7,12 @@ we do not create a new type object, we just record the
existing one under a new
'''
from os.path import join
-from xml.etree.cElementTree import parse
+from sys import version_info
+
+if version_info[:2] >= (3, 3):
+ from xml.etree.ElementTree import parse
+else:
+ from xml.etree.cElementTree import parse
from xcbgen.xtypes import *
=====================================
xcbgen/state.py
=====================================
@@ -2,7 +2,12 @@
This module contains the namespace class and the singleton module class.
'''
from os.path import dirname, basename
-from xml.etree.cElementTree import parse
+from sys import version_info
+
+if version_info[:2] >= (3, 3):
+ from xml.etree.ElementTree import parse
+else:
+ from xml.etree.cElementTree import parse
from xcbgen import matcher
from xcbgen.error import *
=====================================
xcbgen/xtypes.py
=====================================
@@ -528,10 +528,10 @@ class ComplexType(Type):
def resolve(self, module):
if self.resolved:
return
- enum = None
# Resolve all of our field datatypes.
for child in list(self.elt):
+ enum = None
if child.tag == 'pad':
field_name = 'pad' + str(module.pads)
fkey = 'CARD8'
View it on GitLab:
https://salsa.debian.org/xorg-team/proto/xcb-proto/-/compare/73d84bf39be7f3d8c90d7494bd4641456f2c8ef9...496e3ce329c3cc9b32af4054c30fa0f306deb007
--
View it on GitLab:
https://salsa.debian.org/xorg-team/proto/xcb-proto/-/compare/73d84bf39be7f3d8c90d7494bd4641456f2c8ef9...496e3ce329c3cc9b32af4054c30fa0f306deb007
You're receiving this email because of your account on salsa.debian.org.