telepathy-salut/telepathy-salut-0.8.1-python3.patch

146 lines
5.7 KiB
Diff

diff -up telepathy-salut-0.8.1/tools/glib-client-marshaller-gen.py.py3 telepathy-salut-0.8.1/tools/glib-client-marshaller-gen.py
--- telepathy-salut-0.8.1/tools/glib-client-marshaller-gen.py.py3 2011-08-16 07:04:41.000000000 -0400
+++ telepathy-salut-0.8.1/tools/glib-client-marshaller-gen.py 2019-12-20 11:19:32.682996743 -0500
@@ -31,22 +31,22 @@ class Generator(object):
for signal in signals:
self.do_signal(signal)
- print 'void'
- print '%s_register_dbus_glib_marshallers (void)' % self.prefix
- print '{'
+ print('void')
+ print('%s_register_dbus_glib_marshallers (void)' % self.prefix)
+ print('{')
- all = self.marshallers.keys()
- all.sort()
+ all = list(self.marshallers.keys())
+ sorted(all)
for marshaller in all:
rhs = self.marshallers[marshaller]
- print ' dbus_g_object_register_marshaller (%s,' % marshaller
- print ' G_TYPE_NONE, /* return */'
+ print(' dbus_g_object_register_marshaller (%s,' % marshaller)
+ print(' G_TYPE_NONE, /* return */')
for type in rhs:
- print ' G_TYPE_%s,' % type.replace('VOID', 'NONE')
- print ' G_TYPE_INVALID);'
+ print(' G_TYPE_%s,' % type.replace('VOID', 'NONE'))
+ print(' G_TYPE_INVALID);')
- print '}'
+ print('}')
def types_to_gtypes(types):
diff -up telepathy-salut-0.8.1/tools/glib-ginterface-gen.py.py3 telepathy-salut-0.8.1/tools/glib-ginterface-gen.py
--- telepathy-salut-0.8.1/tools/glib-ginterface-gen.py.py3 2011-08-16 07:04:41.000000000 -0400
+++ telepathy-salut-0.8.1/tools/glib-ginterface-gen.py 2019-12-20 11:19:32.683996724 -0500
@@ -26,7 +26,7 @@ import sys
import os.path
import xml.dom.minidom
-from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \
+from libglibcodegen import Signature, type_to_gtype, \
camelcase_to_lower, NS_TP, dbus_gutils_wincaps_to_uscore, \
signal_to_marshal_name, method_to_glue_marshal_name
@@ -620,7 +620,7 @@ class Generator(object):
self.b('')
nodes = self.dom.getElementsByTagName('node')
- nodes.sort(cmp_by_name)
+ nodes.sort(key=lambda node : node.getAttributeNode('name').nodeValue)
for node in nodes:
self.do_node(node)
@@ -639,7 +639,7 @@ class Generator(object):
def cmdline_error():
- print """\
+ print("""\
usage:
gen-ginterface [OPTIONS] xmlfile Prefix_
options:
@@ -659,7 +659,7 @@ options:
void symbol (DBusGMethodInvocation *context)
and return some sort of "not implemented" error via
dbus_g_method_return_error (context, ...)
-"""
+""")
sys.exit(1)
diff -up telepathy-salut-0.8.1/tools/glib-signals-marshal-gen.py.py3 telepathy-salut-0.8.1/tools/glib-signals-marshal-gen.py
--- telepathy-salut-0.8.1/tools/glib-signals-marshal-gen.py.py3 2011-08-16 07:04:41.000000000 -0400
+++ telepathy-salut-0.8.1/tools/glib-signals-marshal-gen.py 2019-12-20 11:19:32.683996724 -0500
@@ -42,11 +42,11 @@ class Generator(object):
self.do_signal(signal)
all = self.marshallers.keys()
- all.sort()
+ sorted(all)
for marshaller in all:
rhs = self.marshallers[marshaller]
if not marshaller.startswith('g_cclosure'):
- print 'VOID:' + ','.join(rhs)
+ print('VOID:' + ','.join(rhs))
if __name__ == '__main__':
argv = sys.argv[1:]
diff -up telepathy-salut-0.8.1/tools/libglibcodegen.py.py3 telepathy-salut-0.8.1/tools/libglibcodegen.py
--- telepathy-salut-0.8.1/tools/libglibcodegen.py.py3 2011-07-07 11:24:48.000000000 -0400
+++ telepathy-salut-0.8.1/tools/libglibcodegen.py 2019-12-20 11:22:38.687463535 -0500
@@ -191,7 +191,10 @@ class _SignatureIter:
def __init__(self, string):
self.remaining = string
- def next(self):
+ def __iter__(self):
+ self
+
+ def __next__(self):
if self.remaining == '':
raise StopIteration
@@ -297,7 +300,7 @@ def type_to_gtype(s):
return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False)
elif s[:2] == 'a{': #some arbitrary hash tables
if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'):
- raise Exception, "can't index a hashtable off non-basic type " + s
+ raise Exception("can't index a hashtable off non-basic type " + s)
first = type_to_gtype(s[2])
second = type_to_gtype(s[3:-1])
return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False)
@@ -312,7 +315,7 @@ def type_to_gtype(s):
return ("GValueArray *", gtype, "BOXED", True)
# we just don't know ..
- raise Exception, "don't know the GType for " + s
+ raise Exception("don't know the GType for " + s)
def xml_escape(s):
diff -up telepathy-salut-0.8.1/tools/make-release-mail.py.py3 telepathy-salut-0.8.1/tools/make-release-mail.py
--- telepathy-salut-0.8.1/tools/make-release-mail.py.py3 2012-11-12 09:13:18.000000000 -0500
+++ telepathy-salut-0.8.1/tools/make-release-mail.py 2019-12-20 11:19:32.684996705 -0500
@@ -50,14 +50,14 @@ GIT_URL = 'http://cgit.freedesktop.org/t
def main(package, version, news_path):
release_name, details = extract_description(package, version, news_path)
- print """
+ print("""
%(release_name)s
tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz
signature: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz.asc
git: %(git_url)s/%(package)s
-%(details)s""".strip().rstrip() % {
+%(details)s""").strip().rstrip() % {
'base_url': BASE_URL,
'git_url': GIT_URL,
'package': package,