At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
------------------------------------------------------------
revno: 160
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Thu 2007-09-20 14:39:05 +0200
message:
Fixed perl and python mgm build issues.
modified:
perl/mgmapi.i mgmapi.i-20070415084702-pjs702i1rleb6otl-1
python/mgmapi.i
svn-v2:10@5fca6d9a-db22-0410-b55c-899b0a28da89-trunk-python%2fmgm.i
=== modified file 'perl/mgmapi.i'
--- a/perl/mgmapi.i 2007-07-25 14:16:35 +0000
+++ b/perl/mgmapi.i 2007-09-20 12:39:05 +0000
@@ -23,6 +23,11 @@
%{
#undef SWIG_exception
#define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
+
+#define NDB_exception(excp, msg) do { sv_setpvf(GvSV(PL_errgv),#excp " %s\n", msg);
SWIG_fail; } while (0)
+
+#include <my_global.h>
+
%}
%include "mgmglobals.i"
=== modified file 'python/mgmapi.i'
--- a/python/mgmapi.i 2007-07-25 17:20:31 +0000
+++ b/python/mgmapi.i 2007-09-20 12:39:05 +0000
@@ -27,5 +27,90 @@
%init %{
ndb_init();
+
+ NEW_pyexcept(NdbApiException,NULL);
+ NEW_pyexcept(NdbApiRuntimeException,PyExc_NdbApiException);
+ NEW_pyexcept(NdbApiPermanentException,PyExc_NdbApiException);
+ NEW_pyexcept(NdbApiTemporaryException,PyExc_NdbApiException);
+ NEW_pyexcept(NdbApiUserErrorPermanentException,PyExc_NdbApiPermanentException);
+ NEW_pyexcept(NdbClusterConnectionPermanentException,PyExc_NdbApiPermanentException);
+ NEW_pyexcept(NdbClusterConnectionTemporaryException,PyExc_NdbApiTemporaryException);
+ NEW_pyexcept(NdbApiTimeStampOutOfBoundsException,PyExc_NdbApiException);
+ NEW_pyexcept(BlobUndefinedException,PyExc_NdbApiException);
+ NEW_pyexcept(NoSuchColumnException,PyExc_NdbApiException);
+ NEW_pyexcept(NoSuchIndexException,PyExc_NdbApiException);
+ NEW_pyexcept(NoSuchTableException,PyExc_NdbApiException);
+
%}
+%{
+
+#define NEW_pyexcept(EXCPT,EPARENT) { PyExc_ ## EXCPT =
PyErr_NewException("mysql.cluster.ndbapi." #EXCPT ,EPARENT,NULL); PyDict_SetItemString(d,
#EXCPT ,PyExc_ ## EXCPT); Py_INCREF(PyExc_ ## EXCPT); }
+
+ PyObject * PyExc_NdbApiException;
+ PyObject * PyExc_BlobUndefinedException;
+ PyObject * PyExc_NdbApiPermanentException;
+ PyObject * PyExc_NdbApiRuntimeException;
+ PyObject * PyExc_NdbApiTemporaryException;
+ PyObject * PyExc_NdbApiTimeStampOutOfBoundsException;
+ PyObject * PyExc_NdbApiUserErrorPermanentException;
+ PyObject * PyExc_NdbClusterConnectionPermanentException;
+ PyObject * PyExc_NdbClusterConnectionTemporaryException;
+ PyObject * PyExc_NoSuchColumnException;
+ PyObject * PyExc_NoSuchIndexException;
+ PyObject * PyExc_NoSuchTableException;
+
+#define NDB_exception(excp, msg) { ndb_throw_exception(excp,msg); SWIG_fail; }
+
+ void ndb_throw_exception(NdbException excp_mod, const char * msg) {
+
+ PyObject * exception;
+
+ switch (excp_mod) {
+ case NdbApiException:
+ exception = PyExc_NdbApiException;
+ break;
+ case BlobUndefinedException:
+ exception = PyExc_BlobUndefinedException;
+ break;
+ case NdbApiPermanentException:
+ exception = PyExc_NdbApiPermanentException;
+ break;
+ case NdbApiRuntimeException:
+ exception = PyExc_NdbApiRuntimeException;
+ break;
+ case NdbApiTemporaryException:
+ exception = PyExc_NdbApiTemporaryException;
+ break;
+ case NdbApiTimeStampOutOfBoundsException:
+ exception = PyExc_NdbApiTimeStampOutOfBoundsException;
+ break;
+ case NdbApiUserErrorPermanentException:
+ exception = PyExc_NdbApiUserErrorPermanentException;
+ break;
+ case NdbClusterConnectionPermanentException:
+ exception = PyExc_NdbClusterConnectionPermanentException;
+ break;
+ case NdbClusterConnectionTemporaryException:
+ exception = PyExc_NdbClusterConnectionTemporaryException;
+ break;
+ case NoSuchColumnException:
+ exception = PyExc_NoSuchColumnException;
+ break;
+ case NoSuchIndexException:
+ exception = PyExc_NoSuchIndexException;
+ break;
+ case NoSuchTableException:
+ exception = PyExc_NoSuchTableException;
+ break;
+ default:
+ exception = PyExc_RuntimeError;
+ }
+ exception = PyExc_NdbApiException;
+ PyErr_SetString(exception,msg);
+ Py_INCREF(exception);
+ }
+
+
+
+ %}
| Thread |
|---|
| • Rev 160: Fixed perl and python mgm build issues. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge | Monty Taylor | 20 Sep |