summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2012-04-16 17:03:34 +0000
committerTed Ross <tross@apache.org>2012-04-16 17:03:34 +0000
commitfefeddb38c72a207d0feab8d652a163a3fb1bd56 (patch)
tree6746b2492ccc70eccd88ff7c776202bfd04bb021
parent01fb5a4c1c6ebab79a0a172178a6b16eaa624076 (diff)
downloadqpid-python-fefeddb38c72a207d0feab8d652a163a3fb1bd56.tar.gz
QPID-3946 - Back-ported to 0.16.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.16@1326686 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/bindings/qpid/python/python.i37
-rw-r--r--qpid/cpp/bindings/swig_python_typemaps.i6
2 files changed, 22 insertions, 21 deletions
diff --git a/qpid/cpp/bindings/qpid/python/python.i b/qpid/cpp/bindings/qpid/python/python.i
index 48d8855d1a..a53cf3b853 100644
--- a/qpid/cpp/bindings/qpid/python/python.i
+++ b/qpid/cpp/bindings/qpid/python/python.i
@@ -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 = []
diff --git a/qpid/cpp/bindings/swig_python_typemaps.i b/qpid/cpp/bindings/swig_python_typemaps.i
index e99ce65254..25a4e46b18 100644
--- a/qpid/cpp/bindings/swig_python_typemaps.i
+++ b/qpid/cpp/bindings/swig_python_typemaps.i
@@ -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