mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-20 08:57:50 +02:00
gdbus-codegen: Tidy up version comparisons
Python tuple comparisons actually do what we want for comparing major and minor versions, so tidy things up by using that. This introduces no functional changes. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -73,10 +73,6 @@ class HeaderCodeGenerator:
|
||||
self.glib_min_required = glib_min_required
|
||||
self.outfile = outfile
|
||||
|
||||
self.glib_min_required_is_2_64 = (glib_min_required[0] > 2 or
|
||||
(glib_min_required[0] == 2 and
|
||||
glib_min_required[1] >= 64))
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
|
||||
def generate_header_preamble(self):
|
||||
@@ -226,7 +222,7 @@ class HeaderCodeGenerator:
|
||||
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
|
||||
for a in m.in_args:
|
||||
self.outfile.write(',\n %sarg_%s'%(a.ctype_in, a.name))
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(',\n GDBusCallFlags call_flags'
|
||||
',\n gint timeout_msec')
|
||||
if m.unix_fd:
|
||||
@@ -256,7 +252,7 @@ class HeaderCodeGenerator:
|
||||
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
|
||||
for a in m.in_args:
|
||||
self.outfile.write(',\n %sarg_%s'%(a.ctype_in, a.name))
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(',\n GDBusCallFlags call_flags'
|
||||
',\n gint timeout_msec')
|
||||
if m.unix_fd:
|
||||
@@ -926,10 +922,6 @@ class CodeGenerator:
|
||||
self.glib_min_required = glib_min_required
|
||||
self.outfile = outfile
|
||||
|
||||
self.glib_min_required_is_2_64 = (glib_min_required[0] > 2 or
|
||||
(glib_min_required[0] == 2 and
|
||||
glib_min_required[1] >= 64))
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
|
||||
def generate_body_preamble(self):
|
||||
@@ -1680,7 +1672,7 @@ class CodeGenerator:
|
||||
%(i.name_lower, m.name_lower, i.camel_name))
|
||||
for a in m.in_args:
|
||||
self.outfile.write(' * @arg_%s: Argument to pass with the method invocation.\n'%(a.name))
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(' * @call_flags: Flags from the #GDBusCallFlags enumeration. If you want to allow interactive\n'
|
||||
' authorization be sure to set %G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION.\n'
|
||||
' * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or\n'
|
||||
@@ -1704,7 +1696,7 @@ class CodeGenerator:
|
||||
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
|
||||
for a in m.in_args:
|
||||
self.outfile.write(',\n %sarg_%s'%(a.ctype_in, a.name))
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(',\n GDBusCallFlags call_flags'
|
||||
',\n gint timeout_msec')
|
||||
if m.unix_fd:
|
||||
@@ -1726,7 +1718,7 @@ class CodeGenerator:
|
||||
for a in m.in_args:
|
||||
self.outfile.write(',\n arg_%s'%(a.name))
|
||||
self.outfile.write('),\n')
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(' call_flags,\n'
|
||||
' timeout_msec,\n')
|
||||
else:
|
||||
@@ -1797,7 +1789,7 @@ class CodeGenerator:
|
||||
%(i.name_lower, m.name_lower, i.camel_name))
|
||||
for a in m.in_args:
|
||||
self.outfile.write(' * @arg_%s: Argument to pass with the method invocation.\n'%(a.name))
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(' * @call_flags: Flags from the #GDBusCallFlags enumeration. If you want to allow interactive\n'
|
||||
' authorization be sure to set %G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION.\n'
|
||||
' * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or\n'
|
||||
@@ -1824,7 +1816,7 @@ class CodeGenerator:
|
||||
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
|
||||
for a in m.in_args:
|
||||
self.outfile.write(',\n %sarg_%s'%(a.ctype_in, a.name))
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(',\n GDBusCallFlags call_flags'
|
||||
',\n gint timeout_msec')
|
||||
if m.unix_fd:
|
||||
@@ -1850,7 +1842,7 @@ class CodeGenerator:
|
||||
for a in m.in_args:
|
||||
self.outfile.write(',\n arg_%s'%(a.name))
|
||||
self.outfile.write('),\n')
|
||||
if self.glib_min_required_is_2_64:
|
||||
if self.glib_min_required >= (2, 64):
|
||||
self.outfile.write(' call_flags,\n'
|
||||
' timeout_msec,\n')
|
||||
else:
|
||||
|
Reference in New Issue
Block a user