mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-18 16:07:50 +02:00
Updated codegen to work with python3.
Most changes were just replacing usage of "has_key" with "in". Also updated the sorting function which was simplified and changed to a "key" function instead of "cmp" (which is no longer supported in python3. Verified everything builds with python 2.7 and 3. https://bugzilla.gnome.org/show_bug.cgi?id=678066
This commit is contained in:
committed by
Colin Walters
parent
6d5484b296
commit
03611f7c06
@@ -304,11 +304,8 @@ class CodeGenerator:
|
||||
#
|
||||
# See https://bugzilla.gnome.org/show_bug.cgi?id=647577#c5
|
||||
# for discussion
|
||||
keys = function_pointers.keys()
|
||||
if len(keys) > 0:
|
||||
keys.sort(cmp=utils.my_version_cmp)
|
||||
for key in keys:
|
||||
self.h.write('%s'%function_pointers[key])
|
||||
for key in sorted(function_pointers.keys(), key=utils.version_cmp_key):
|
||||
self.h.write('%s'%function_pointers[key])
|
||||
|
||||
self.h.write('};\n')
|
||||
self.h.write('\n')
|
||||
@@ -1022,11 +1019,9 @@ class CodeGenerator:
|
||||
value = '@get_%s: '%(p.name_lower)
|
||||
value += 'Getter for the #%s:%s property.'%(i.camel_name, p.name_hyphen)
|
||||
doc_bits[key] = value
|
||||
keys = doc_bits.keys()
|
||||
if len(keys) > 0:
|
||||
keys.sort(cmp=utils.my_version_cmp)
|
||||
for key in keys:
|
||||
self.c.write(' * %s\n'%doc_bits[key])
|
||||
for key in sorted(doc_bits.keys(), key=utils.version_cmp_key):
|
||||
self.c.write(' * %s\n'%doc_bits[key])
|
||||
|
||||
self.c.write(self.docbook_gen.expand(
|
||||
' *\n'
|
||||
' * Virtual table for the D-Bus interface #%s.\n'
|
||||
|
Reference in New Issue
Block a user