From: Lukas Doktor <ldoktor@redhat.com>
To: ldoktor@redhat.com, jzupka@redhat.com, autotest@test.kernel.org,
kvm@vger.kernel.org, lmr@redhat.com
Subject: [PATCH] FIX matrix_to_string: header columns width ADD matrix_to_string: accept header of type tupple or list
Date: Wed, 29 Sep 2010 11:33:14 +0200 [thread overview]
Message-ID: <1285752794-17191-2-git-send-email-ldoktor@redhat.com> (raw)
In-Reply-To: <1285752794-17191-1-git-send-email-ldoktor@redhat.com>
Signed-off-by: Lukas Doktor <ldoktor@redhat.com>
---
client/common_lib/utils.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index f44dd1e..6b8cdf6 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -211,9 +211,14 @@ def matrix_to_string(matrix, header=None):
in each column, and determining the format string dynamically.
@param matrix: Matrix representation (list with n rows of m elements).
- @param header: Optional tuple with header elements to be displayed.
+ @param header: Optional tuple or list with header elements to be displayed.
"""
+ if type(header) is list:
+ header = tuple(header)
lengths = []
+ if header:
+ for column in header:
+ lengths.append(len(column))
for row in matrix:
for column in row:
i = row.index(column)
--
1.7.2.3
next prev parent reply other threads:[~2010-09-29 9:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-29 9:33 [KVM-autotest][patch] matrix_to_string: header columns width Lukas Doktor
2010-09-29 9:33 ` Lukas Doktor [this message]
2010-09-29 11:02 ` [PATCH] FIX matrix_to_string: header columns width ADD matrix_to_string: accept header of type tupple or list Lucas Meneghel Rodrigues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285752794-17191-2-git-send-email-ldoktor@redhat.com \
--to=ldoktor@redhat.com \
--cc=autotest@test.kernel.org \
--cc=jzupka@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lmr@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox