Mercurial > libervia-backend
comparison src/bridge/bridge_constructor/bridge_constructor.py @ 1062:95758ef3faa8
bridge: async failures are more detailed (full class name + error message)
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 07 Jun 2014 15:20:39 +0200 |
parents | 7e43ea75cce8 |
children | d123d61976c8 |
comparison
equal
deleted
inserted
replaced
1061:3700165d68dc | 1062:95758ef3faa8 |
---|---|
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(err._dbus_error_name[len(const_ERROR_PREFIX)+1:])' if async else '' | 453 completion['async_args_result'] = '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 |