diff options
author | Ted Ross <tross@apache.org> | 2012-07-20 16:19:28 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2012-07-20 16:19:28 +0000 |
commit | b45091695a1a93844a32f9194af833f28c195cbe (patch) | |
tree | 5cd6759a119a38f4b56779759905cbc3f7e6e7c6 | |
parent | 4d2076e247c1ac53240688242e148a1b0d574c9e (diff) | |
download | qpid-python-b45091695a1a93844a32f9194af833f28c195cbe.tar.gz |
QPID-4155 - Merged from trunk at revision 1363861.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.18@1363863 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/tools/src/py/qpidtoollibs/disp.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/qpid/tools/src/py/qpidtoollibs/disp.py b/qpid/tools/src/py/qpidtoollibs/disp.py index 53e7bee267..21e09f8d00 100644 --- a/qpid/tools/src/py/qpidtoollibs/disp.py +++ b/qpid/tools/src/py/qpidtoollibs/disp.py @@ -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 |