[Xcb] [PATCH 1/2] Fix enum number generation.

Julien Danjou julien at danjou.info
Sun Jan 24 09:39:59 PST 2010


Signed-off-by: Julien Danjou <julien at danjou.info>
---

Without this patch, the generated atom list in xproto.py is wrong, it does:
 None = 0
 Any = 0
 Primary = 2

Where as it should be:
 None = 0
 Any = 0
 Primary = 1

And that's what the patch fix.

 src/py_client.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/py_client.py b/src/py_client.py
index c25e39d..961c60c 100755
--- a/src/py_client.py
+++ b/src/py_client.py
@@ -175,7 +175,10 @@ def py_enum(self, name):
 
     for (enam, eval) in self.values:
         _py('    %s = %s', _n(enam), eval if eval != '' else count)
-        count += 1
+        if eval != '':
+            count = int(eval) + 1
+        else:
+            count += 1
 
 def _py_type_setup(self, name, postfix=''):
     '''
-- 
1.6.6



More information about the Xcb mailing list