From a6015b59df56bd711fe8f3b99c558256c2abf9ef Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 29 Apr 2011 14:33:47 +0000 Subject: [PATCH] =?UTF-8?q?fix=20for=20a=20bug=20reported=20by=20jaccovant?= =?UTF-8?q?uijl@gmail.=E2=80=8Bcom=20(entries=20=3D=20zip(*[entries[colNam?= =?UTF-8?q?e]=20for=20colName=20in=20colList]))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/generic/enumeration.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 84e51fa82..8202f63db 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1183,6 +1183,10 @@ class Enumeration: logger.info(infoMsg) return entries + for column in colList: + lengths[column] = 0 + entries[column] = [] + colList = sorted(colList, key=lambda x: len(x) if x else MAX_INT) for column in colList: @@ -1199,6 +1203,7 @@ class Enumeration: if isNumPosStrValue(value): validColumnList = True + if value == count: infoMsg = "using column '%s' as a pivot " % column infoMsg += "for retrieving row data" @@ -1228,12 +1233,6 @@ class Enumeration: break for column in colList: - if column not in lengths: - lengths[column] = 0 - - if column not in entries: - entries[column] = [] - if column == colList[0]: # Correction for pivotValues with unrecognized chars if pivotValue and '?' in pivotValue and pivotValue[0] != '?':