diff options
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rw-r--r-- | cpp/src/Slice/PythonUtil.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 3a1330eeb74..c46cc209f2a 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -302,17 +302,31 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p) _out << ", ctx=None):"; _out.inc(); _out << nl << "return _M_" << fixedScoped << "._op_" << (*oli)->name() << ".invoke(self, (" << inParams; - if(!inParams.empty()) + if(!inParams.empty() && inParams.find(',') == string::npos) { _out << ", "; } - _out << "ctx"; - if(inParams.empty()) + _out << "), ctx)"; + _out.dec(); + + if(p->hasMetaData("ami") || (*oli)->hasMetaData("ami")) { - _out << ','; + _out << sp << nl << "def " << fixedOpName << "_async(self, _cb"; + if(!inParams.empty()) + { + _out << ", " << inParams; + } + _out << ", ctx=None):"; + _out.inc(); + _out << nl << "return _M_" << fixedScoped << "._op_" << (*oli)->name() << ".invokeAsync(self, _cb, (" + << inParams; + if(!inParams.empty() && inParams.find(',') == string::npos) + { + _out << ", "; + } + _out << "), ctx)"; + _out.dec(); } - _out << "))"; - _out.dec(); } _out << sp << nl << "def checkedCast(proxy, facet=''):"; |