From c8b5966a0be8b28e2145b7c6f42ace33ac1de87a Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Sat, 11 Sep 2004 00:53:36 +0000 Subject: adding AMI support --- cpp/src/Slice/PythonUtil.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'cpp/src/Slice/PythonUtil.cpp') 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=''):"; -- cgit v1.2.3