summaryrefslogtreecommitdiff
path: root/tools/glib-errors-check-gen.py
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-23 16:05:45 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-09-25 11:00:48 +0200
commit4a9fdeb64bc87f09e44ecc0f9c6acaea8bf11f20 (patch)
tree41bb3585a34125aaa26408de78da312226a0bc7c /tools/glib-errors-check-gen.py
parent15f9b0e7259c46747326758d62c5a9ecb6ce3af2 (diff)
downloadtelepathy-logger-4a9fdeb64bc87f09e44ecc0f9c6acaea8bf11f20.tar.gz
sync tools/ with tp-glib master
Needed to stop using deprecated API in generated code. https://bugs.freedesktop.org/show_bug.cgi?id=69797
Diffstat (limited to 'tools/glib-errors-check-gen.py')
-rw-r--r--tools/glib-errors-check-gen.py62
1 files changed, 31 insertions, 31 deletions
diff --git a/tools/glib-errors-check-gen.py b/tools/glib-errors-check-gen.py
index 553fc9c..fad261e 100644
--- a/tools/glib-errors-check-gen.py
+++ b/tools/glib-errors-check-gen.py
@@ -12,13 +12,13 @@ class Generator(object):
def __call__(self):
- print '{'
- print ' GEnumClass *klass;'
- print ' GEnumValue *value_by_name;'
- print ' GEnumValue *value_by_nick;'
- print ''
- print ' g_type_init ();'
- print ' klass = g_type_class_ref (TP_TYPE_ERROR);'
+ print('{')
+ print(' GEnumClass *klass;')
+ print(' GEnumValue *value_by_name;')
+ print(' GEnumValue *value_by_nick;')
+ print('')
+ print(' g_type_init ();')
+ print(' klass = g_type_class_ref (TP_TYPE_ERROR);')
for error in self.errors.getElementsByTagNameNS(NS_TP, 'error'):
ns = error.parentNode.getAttribute('namespace')
@@ -28,30 +28,30 @@ class Generator(object):
s = ('TP_ERROR_STR_' +
error.getAttribute('name').replace(' ', '_').replace('.', '_').upper())
- print ''
- print ' /* %s.%s */' % (ns, nick)
- print (' value_by_name = g_enum_get_value_by_name (klass, "%s");'
- % enum)
- print (' value_by_nick = g_enum_get_value_by_nick (klass, "%s");'
- % nick)
- print (' g_assert (value_by_name != NULL);')
- print (' g_assert (value_by_nick != NULL);')
- print (' g_assert_cmpint (value_by_name->value, ==, %s);'
- % enum)
- print (' g_assert_cmpint (value_by_nick->value, ==, %s);'
- % enum)
- print (' g_assert_cmpstr (value_by_name->value_name, ==, "%s");'
- % enum)
- print (' g_assert_cmpstr (value_by_nick->value_name, ==, "%s");'
- % enum)
- print (' g_assert_cmpstr (value_by_name->value_nick, ==, "%s");'
- % nick)
- print (' g_assert_cmpstr (value_by_nick->value_nick, ==, "%s");'
- % nick)
- print (' g_assert_cmpstr (%s, ==, TP_ERROR_PREFIX ".%s");'
- % (s, nick))
-
- print '}'
+ print('')
+ print(' /* %s.%s */' % (ns, nick))
+ print(' value_by_name = g_enum_get_value_by_name (klass, "%s");'
+ % enum)
+ print(' value_by_nick = g_enum_get_value_by_nick (klass, "%s");'
+ % nick)
+ print(' g_assert (value_by_name != NULL);')
+ print(' g_assert (value_by_nick != NULL);')
+ print(' g_assert_cmpint (value_by_name->value, ==, %s);'
+ % enum)
+ print(' g_assert_cmpint (value_by_nick->value, ==, %s);'
+ % enum)
+ print(' g_assert_cmpstr (value_by_name->value_name, ==, "%s");'
+ % enum)
+ print(' g_assert_cmpstr (value_by_nick->value_name, ==, "%s");'
+ % enum)
+ print(' g_assert_cmpstr (value_by_name->value_nick, ==, "%s");'
+ % nick)
+ print(' g_assert_cmpstr (value_by_nick->value_nick, ==, "%s");'
+ % nick)
+ print(' g_assert_cmpstr (%s, ==, TP_ERROR_PREFIX ".%s");'
+ % (s, nick))
+
+ print('}')
if __name__ == '__main__':
argv = sys.argv[1:]