[ibpy commit] r323 - trunk/ib/opt

1 view
Skip to first unread message

codesite...@google.com

unread,
Jul 31, 2008, 1:28:50 PM7/31/08
to ibpy-...@googlegroups.com
Author: troy.melhase
Date: Thu Jul 24 22:17:07 2008
New Revision: 323

Modified:
trunk/ib/opt/message.py

Log:
Minor change to message string formatting. Also added default to key
lookups to support older (serialized) message objects.

Modified: trunk/ib/opt/message.py
==============================================================================
--- trunk/ib/opt/message.py (original)
+++ trunk/ib/opt/message.py Thu Jul 24 22:17:07 2008
@@ -64,7 +64,7 @@
"""
name = self.typeName
items = str.join(', ', ['%s=%s' % item for item in self.items()])
- return '<%s message%s>' % (name, ' ' + items if items else '')
+ return '<%s %s>' % (name, ' ' + items if items else '')

def items(self):
""" List of message (slot, slot value) pairs, as 2-tuples.
@@ -78,7 +78,7 @@

@return list of each slot value
"""
- return [getattr(self, key) for key in self.keys()]
+ return [getattr(self, key, None) for key in self.keys()]

def keys(self):
""" List of instance slots.

Reply all
Reply to author
Forward
0 new messages