You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2012/04/13 23:59:22 UTC
svn commit: r1325977 - in /qpid/trunk/qpid/cpp/bindings:
qpid/python/python.i swig_python_typemaps.i
Author: tross
Date: Fri Apr 13 21:59:21 2012
New Revision: 1325977
URL: http://svn.apache.org/viewvc?rev=1325977&view=rev
Log:
QPID-3946 - Make swig python wrappers compatible with older versions of Python and Swig.
Modified:
qpid/trunk/qpid/cpp/bindings/qpid/python/python.i
qpid/trunk/qpid/cpp/bindings/swig_python_typemaps.i
Modified: qpid/trunk/qpid/cpp/bindings/qpid/python/python.i
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/python/python.i?rev=1325977&r1=1325976&r2=1325977&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/python/python.i (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/python/python.i Fri Apr 13 21:59:21 2012
@@ -199,7 +199,7 @@ static PyObject* pTransportFailure;
self._acknowledge_all(sync)
__swig_getmethods__["connection"] = getConnection
- if _newclass: connection = _swig_property(getConnection)
+ if _newclass: connection = property(getConnection)
%}
}
@@ -208,10 +208,10 @@ static PyObject* pTransportFailure;
%pythoncode %{
__swig_getmethods__["capacity"] = getCapacity
__swig_setmethods__["capacity"] = setCapacity
- if _newclass: capacity = _swig_property(getCapacity, setCapacity)
+ if _newclass: capacity = property(getCapacity, setCapacity)
__swig_getmethods__["session"] = getSession
- if _newclass: session = _swig_property(getSession)
+ if _newclass: session = property(getSession)
%}
%pythoncode %{
@@ -236,10 +236,10 @@ static PyObject* pTransportFailure;
__swig_getmethods__["capacity"] = getCapacity
__swig_setmethods__["capacity"] = setCapacity
- if _newclass: capacity = _swig_property(getCapacity, setCapacity)
+ if _newclass: capacity = property(getCapacity, setCapacity)
__swig_getmethods__["session"] = getSession
- if _newclass: session = _swig_property(getSession)
+ if _newclass: session = property(getSession)
%}
}
@@ -301,24 +301,23 @@ static PyObject* pTransportFailure;
self.setContent(content)
__swig_getmethods__["content"] = _get_content
__swig_setmethods__["content"] = _set_content
- if _newclass: content = _swig_property(_get_content, _set_content)
+ if _newclass: content = property(_get_content, _set_content)
__swig_getmethods__["content_type"] = getContentType
__swig_setmethods__["content_type"] = setContentType
- if _newclass: content_type = _swig_property(getContentType,
- setContentType)
+ if _newclass: content_type = property(getContentType, setContentType)
__swig_getmethods__["id"] = getMessageId
__swig_setmethods__["id"] = setMessageId
- if _newclass: id = _swig_property(getMessageId, setMessageId)
+ if _newclass: id = property(getMessageId, setMessageId)
__swig_getmethods__["subject"] = getSubject
__swig_setmethods__["subject"] = setSubject
- if _newclass: subject = _swig_property(getSubject, setSubject)
+ if _newclass: subject = property(getSubject, setSubject)
__swig_getmethods__["priority"] = getPriority
__swig_setmethods__["priority"] = setPriority
- if _newclass: priority = _swig_property(getPriority, setPriority)
+ if _newclass: priority = property(getPriority, setPriority)
def getTtl(self) :
return self._getTtl().getMilliseconds()/1000.0
@@ -326,28 +325,26 @@ static PyObject* pTransportFailure;
self._setTtl(Duration(int(1000*duration)))
__swig_getmethods__["ttl"] = getTtl
__swig_setmethods__["ttl"] = setTtl
- if _newclass: ttl = _swig_property(getTtl, setTtl)
+ if _newclass: ttl = property(getTtl, setTtl)
__swig_getmethods__["user_id"] = getUserId
__swig_setmethods__["user_id"] = setUserId
- if _newclass: user_id = _swig_property(getUserId, setUserId)
+ if _newclass: user_id = property(getUserId, setUserId)
__swig_getmethods__["correlation_id"] = getCorrelationId
__swig_setmethods__["correlation_id"] = setCorrelationId
- if _newclass: correlation_id = _swig_property(getCorrelationId,
- setCorrelationId)
+ if _newclass: correlation_id = property(getCorrelationId, setCorrelationId)
__swig_getmethods__["redelivered"] = getRedelivered
__swig_setmethods__["redelivered"] = setRedelivered
- if _newclass: redelivered = _swig_property(getRedelivered,
- setRedelivered)
+ if _newclass: redelivered = property(getRedelivered, setRedelivered)
__swig_getmethods__["durable"] = getDurable
__swig_setmethods__["durable"] = setDurable
- if _newclass: durable = _swig_property(getDurable, setDurable)
+ if _newclass: durable = property(getDurable, setDurable)
__swig_getmethods__["properties"] = getProperties
- if _newclass: properties = _swig_property(getProperties)
+ if _newclass: properties = property(getProperties)
def getReplyTo(self) :
return self._getReplyTo().str()
@@ -355,7 +352,7 @@ static PyObject* pTransportFailure;
self._setReplyTo(Address(address_str))
__swig_getmethods__["reply_to"] = getReplyTo
__swig_setmethods__["reply_to"] = setReplyTo
- if _newclass: reply_to = _swig_property(getReplyTo, setReplyTo)
+ if _newclass: reply_to = property(getReplyTo, setReplyTo)
def __repr__(self):
args = []
Modified: qpid/trunk/qpid/cpp/bindings/swig_python_typemaps.i
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/swig_python_typemaps.i?rev=1325977&r1=1325976&r2=1325977&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/swig_python_typemaps.i (original)
+++ qpid/trunk/qpid/cpp/bindings/swig_python_typemaps.i Fri Apr 13 21:59:21 2012
@@ -25,7 +25,11 @@ static PyObject* pUuidModule;
%}
%init %{
- pUuidModule = PyImport_ImportModule("uuid");
+ /* Instead of directly referencing the uuid module (which is not available
+ * on older versions of Python), reference the wrapper defined in
+ * qpid.datatypes.
+ */
+ pUuidModule = PyImport_ImportModule("qpid.datatypes");
/* Although it is not required, we'll publish the uuid module in our
* module, as if this module was a python module and we called
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org