class DisplayHTMLBlockTableWithGraph() seems to work

Fix a bug : month_stats override if iwla.py called twice
This commit is contained in:
2014-12-02 20:49:56 +01:00
parent 63a9b40b46
commit 7d45b45e8a
4 changed files with 36 additions and 12 deletions

View File

@@ -59,6 +59,7 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock):
self.rows = []
self.cols_cssclasses = ['' for e in cols]
self.rows_cssclasses = []
self.table_css = 'iwla_table'
def appendRow(self, row):
self.rows.append(listToStr(row))
@@ -76,7 +77,7 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock):
row >= len(self.rows) or col >= len(self.cols):
raise ValueError('Invalid indices %d,%d' % (row, col))
return self.rows[row][col]
self.rows[row][col] = value
def setCellCSSClass(self, row, col, value):
if row < 0 or col < 0 or\
@@ -118,7 +119,9 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock):
self.cols_cssclasses = values
def _buildHTML(self):
html = '<table>'
style = ''
if self.table_css: style = ' class="%s"' % (self.table_css)
html = '<table%s>' % (style)
if self.cols:
html += '<tr>'
for i in range (0, len(self.cols)):
@@ -149,10 +152,11 @@ class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable):
self.short_titles = short_titles
self.nb_valid_rows = nb_valid_rows
# TOFIX
self.icon_path = '/resources/icon'
self.icon_path = 'resources/icon'
# self.icon_path = self.iwla.getConfValue('icon_path', '/')
self.raw_rows = []
self.maxes = [0 for c in cols]
self.table_graph_css = 'iwla_graph_table'
def appendRow(self, row):
self.raw_rows.append(row)
@@ -187,7 +191,9 @@ class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable):
def _buildHTML(self):
self._computeMax()
html = '<table>'
style = ''
if self.table_graph_css: style = ' class="%s"' % (self.table_graph_css)
html = '<table%s>' % (style)
html += '<tr>'
for i in range(0, self.nb_valid_rows):
row = self.rows[i]