diff --git a/display.py b/display.py index 646d049..ab9e582 100644 --- a/display.py +++ b/display.py @@ -57,13 +57,13 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock): super(DisplayHTMLBlockTable, self).__init__(title=title) self.cols = cols self.rows = [] - self.cols_cssclasses = ['' for e in cols] + self.cols_cssclasses = [''] * len(cols) self.rows_cssclasses = [] self.table_css = 'iwla_table' def appendRow(self, row): self.rows.append(listToStr(row)) - self.rows_cssclasses.append(['' for e in row]) + self.rows_cssclasses.append([''] * len(row)) def getCellValue(self, row, col): if row < 0 or col < 0 or\ @@ -103,8 +103,7 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock): if row < 0 or row >= len(self.rows): raise ValueError('Invalid indice %d' % (row)) - for i in range(0, self.rows_cssclasses[row]): - self.rows_cssclasses[row][i] = value + self.rows_cssclasses[row] = [value] * len(self.rows_cssclasses[row]) def setColCSSClass(self, col, value): if col < 0 or col >= len(self.cols): @@ -155,7 +154,7 @@ class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable): self.icon_path = 'resources/icon' # self.icon_path = self.iwla.getConfValue('icon_path', '/') self.raw_rows = [] - self.maxes = [0 for c in cols] + self.maxes = [0] * len(cols) self.table_graph_css = 'iwla_graph_table' def appendRow(self, row): @@ -213,7 +212,7 @@ class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable): html += '' html += '