[ibpy] r342 committed - Fixes string formatting for messages with no items.

2 views
Skip to first unread message

ib...@googlecode.com

unread,
Dec 3, 2009, 7:21:14 PM12/3/09
to ibpy-...@googlegroups.com
Revision: 342
Author: troy.melhase
Date: Thu Dec 3 16:20:25 2009
Log: Fixes string formatting for messages with no items.
http://code.google.com/p/ibpy/source/detail?r=342

Modified:
/trunk/ib/opt/message.py

=======================================
--- /trunk/ib/opt/message.py Wed Aug 13 15:19:52 2008
+++ /trunk/ib/opt/message.py Thu Dec 3 16:20:25 2009
@@ -70,7 +70,7 @@
"""
name = self.typeName
items = str.join(', ', ['%s=%s' % item for item in self.items()])
- return '<%s %s>' % (name, items)
+ return '<%s%s>' % (name, (' ' + items) if items else '')

def items(self):
""" List of message (slot, slot value) pairs, as 2-tuples.
Reply all
Reply to author
Forward
0 new messages