[
https://issues.apache.org/jira/browse/QPID-5140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13768517#comment-13768517
]
Gordon Sim commented on QPID-5140:
----------------------------------
Ah, I understand the requirement now. However I don't see why you would need to
change the constructor, you just need to add the explicit get()/set() methods,
e.g.:
{noformat}
Index: cpp/bindings/qpid/python/python.i
===================================================================
--- cpp/bindings/qpid/python/python.i (revision 1522807)
+++ cpp/bindings/qpid/python/python.i (working copy)
@@ -316,13 +316,19 @@
def __len__(self):
return self.properties.__len__()
- def __getitem__(self, key):
+ def get(self, key):
return self.properties[key];
- def __setitem__(self, key, value):
+ def __getitem__(self, key):
+ return self.get(key);
+
+ def set(self, key, value):
self.properties[key] = value
self.msg.setProperty(key, value)
+ def __setitem__(self, key, value):
+ self.set(key, value)
+
def __delitem__(self, key):
del self.properties[key]
self.msg.setProperties(self.properties)
{noformat}
> Python swig bindings - Message.properties missing get/set methods
> -----------------------------------------------------------------
>
> Key: QPID-5140
> URL: https://issues.apache.org/jira/browse/QPID-5140
> Project: Qpid
> Issue Type: Bug
> Components: Python Client
> Reporter: Darryl L. Pierce
> Assignee: Darryl L. Pierce
> Fix For: 0.24
>
>
> The bindings have a special wrapper class named MessageProperties. The Python
> examples attempt to access this field as OBJECT.properties in order to invoke
> the get and set methods on what is expected to be a dict.
> It should set the field on a message instance, and also add the set and get
> methods so they can be accessed directly.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]