Mercurial > libervia-backend
comparison src/bridge/bridge_constructor/bridge_constructor.py @ 1072:d123d61976c8
bridge (D-Bus): frontend side now use a 120 s timeout for async calls
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 15 Jun 2014 00:18:28 +0200 |
parents | 95758ef3faa8 |
children | c1e916594e09 |
comparison
equal
deleted
inserted
replaced
1071:eef1f200d733 | 1072:d123d61976c8 |
---|---|
448 if function["type"] == "method": | 448 if function["type"] == "method": |
449 completion['debug'] = "" if not self.options.debug else 'log.debug ("%s")\n%s' % (section, 8 * ' ') | 449 completion['debug'] = "" if not self.options.debug else 'log.debug ("%s")\n%s' % (section, 8 * ' ') |
450 completion['args_result'] = self.getArguments(function['sig_in'], name=arg_doc) | 450 completion['args_result'] = self.getArguments(function['sig_in'], name=arg_doc) |
451 completion['async_args'] = 'callback=None, errback=None' if async else '' | 451 completion['async_args'] = 'callback=None, errback=None' if async else '' |
452 completion['async_comma'] = ', ' if async and function['sig_in'] else '' | 452 completion['async_comma'] = ', ' if async and function['sig_in'] else '' |
453 completion['async_args_result'] = 'reply_handler=callback, error_handler=lambda err:errback(dbus_to_bridge_exception(err))' if async else '' | 453 completion['async_args_result'] = 'timeout=const_TIMEOUT, reply_handler=callback, error_handler=lambda err:errback(dbus_to_bridge_exception(err))' if async else '' |
454 result = "self.db_%(category)s_iface.%(name)s(%(args_result)s%(async_comma)s%(async_args_result)s)" % completion | 454 result = "self.db_%(category)s_iface.%(name)s(%(args_result)s%(async_comma)s%(async_args_result)s)" % completion |
455 completion['result'] = ("unicode(%s)" if self.options.unicode and function['sig_out'] == 's' else "%s") % result | 455 completion['result'] = ("unicode(%s)" if self.options.unicode and function['sig_out'] == 's' else "%s") % result |
456 methods_part.append("""\ | 456 methods_part.append("""\ |
457 def %(name)s(self, %(args)s%(async_comma)s%(async_args)s): | 457 def %(name)s(self, %(args)s%(async_comma)s%(async_args)s): |
458 %(debug)sreturn %(result)s | 458 %(debug)sreturn %(result)s |