(self)
| 87 | return result |
| 88 | |
| 89 | def to_python(self): |
| 90 | if self.static: |
| 91 | args = self.args |
| 92 | else: |
| 93 | args = [Var(self.args[0].type, 'self')] + self.args[1:] |
| 94 | pyargs = ', '.join(a.type.wrap_python_value(a.name) for a in args) |
| 95 | |
| 96 | body = f'result = _lib.{self.name}({pyargs})\n' |
| 97 | body += '_check_errors()\n' |
| 98 | body += self.type.python_postfix() |
| 99 | body += 'return result\n' |
| 100 | if self.static: |
| 101 | pre = '@staticmethod\n' |
| 102 | elif self.getter: |
| 103 | pre = '@property\n' |
| 104 | else: |
| 105 | pre = '' |
| 106 | return pre + Function.pyentry(self.type, args, self.pyname, self.docs) + s(body, indent=4) |
| 107 | |
| 108 | class FunctionWrapper(Function): |
| 109 | def __init__(self, program, type, name, args): |
no test coverage detected