remove namespace requirement for cython wrapper
Only for unittesting wrap geometry.h, not yet tested in real python/cythonrelease/4.3a0
parent
42deeb7bf0
commit
07b1bbfe7f
|
@ -730,8 +730,11 @@ void Class::python_wrapper(FileWriter& wrapperFile) const {
|
|||
|
||||
/* ************************************************************************* */
|
||||
void Class::emit_cython_pxd(FileWriter& pxdFile) const {
|
||||
pxdFile.oss << "cdef extern from \"" << includeFile << "\" namespace \""
|
||||
<< qualifiedNamespaces("::") << "\":" << endl;
|
||||
pxdFile.oss << "cdef extern from \"" << includeFile << "\"";
|
||||
string ns = qualifiedNamespaces("::");
|
||||
if (!ns.empty())
|
||||
pxdFile.oss << " namespace \"" << ns << "\"";
|
||||
pxdFile.oss << ":" << endl;
|
||||
pxdFile.oss << " cdef cppclass " << pxdClassName() << " \"" << qualifiedName("::") << "\"";
|
||||
if (templateArgs.size()>0) {
|
||||
pxdFile.oss << "[";
|
||||
|
|
|
@ -227,18 +227,12 @@ public:
|
|||
|
||||
/// return the Cython class in pxd corresponding to a Python class in pyx
|
||||
std::string pxd_class_in_pyx() const {
|
||||
if (isNonBasicType()) {
|
||||
if (namespaces_.size() > 0)
|
||||
return pxdClassName();
|
||||
else {
|
||||
std::cerr << "Class without namespace: " << pxdClassName() << std::endl;
|
||||
throw std::runtime_error("Error: User type without namespace!!");
|
||||
}
|
||||
}
|
||||
else if (isEigen()) {
|
||||
return name_ + "Xd";
|
||||
} else // basic types and not Eigen
|
||||
return name_;
|
||||
if (isNonBasicType()) {
|
||||
return pxdClassName();
|
||||
} else if (isEigen()) {
|
||||
return name_ + "Xd";
|
||||
} else // basic types and not Eigen
|
||||
return name_;
|
||||
}
|
||||
|
||||
/// the internal Cython shared obj in a Python class wrappper
|
||||
|
|
Loading…
Reference in New Issue