Author: tross
Date: Fri Jul 20 16:19:28 2012
New Revision: 1363863
URL: http://svn.apache.org/viewvc?rev=1363863&view=rev
Log:
QPID-4155 - Merged from trunk at revision 1363861.
Modified:
qpid/branches/0.18/qpid/tools/src/py/qpidtoollibs/disp.py
Modified: qpid/branches/0.18/qpid/tools/src/py/qpidtoollibs/disp.py
URL:
http://svn.apache.org/viewvc/qpid/branches/0.18/qpid/tools/src/py/qpidtoollibs/disp.py?rev=1363863&r1=1363862&r2=1363863&view=diff
==============================================================================
--- qpid/branches/0.18/qpid/tools/src/py/qpidtoollibs/disp.py (original)
+++ qpid/branches/0.18/qpid/tools/src/py/qpidtoollibs/disp.py Fri Jul 20
16:19:28 2012
@@ -167,7 +167,10 @@ class Display:
for head in heads:
width = len (head)
for row in rows:
- cellWidth = len (unicode (row[col].decode('utf-8')))
+ text = row[col]
+ if text.__class__ == str:
+ text = text.decode('utf-8')
+ cellWidth = len(unicode(text))
if cellWidth > width:
width = cellWidth
colWidth.append (width + self.tableSpacing)
@@ -187,9 +190,12 @@ class Display:
line = self.tablePrefix
col = 0
for width in colWidth:
- line = line + unicode (row[col].decode('utf-8'))
+ text = row[col]
+ if text.__class__ == str:
+ text = text.decode('utf-8')
+ line = line + unicode(text)
if col < len (heads) - 1:
- for i in range (width - len (unicode (row[col].decode('utf-8')))):
+ for i in range (width - len(unicode(text))):
line = line + " "
col = col + 1
print line
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]