Compare commits

...

2 Commits

Author SHA1 Message Date
Gregory Soutade
4d0b993aec Update default conf 2024-10-27 09:18:04 +01:00
Gregory Soutade
0211596508 Fix potential division by 0 2024-10-27 09:17:53 +01:00
2 changed files with 4 additions and 1 deletions

View File

@ -70,3 +70,6 @@ excluded_domain_name = []
# Domains that set no-referer as Referer-Policy # Domains that set no-referer as Referer-Policy
no_referrer_domains = [] no_referrer_domains = []
# Domains used by robots
robot_domains = []

View File

@ -207,7 +207,7 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock):
self.insertCol(column_insertion, self.iwla._('Ratio'), u'iwla_hit') self.insertCol(column_insertion, self.iwla._('Ratio'), u'iwla_hit')
for (index, r) in enumerate(self.rows): for (index, r) in enumerate(self.rows):
val = r[column] and int(r[column]) or 0 val = r[column] and int(r[column]) or 0
self.setCellValue(index, column_insertion, '%.1f%%' % (float(val*100)/float(total))) self.setCellValue(index, column_insertion, '%.1f%%' % (total and float(val*100)/float(total) or 0))
def _filter(self, function, column, args): def _filter(self, function, column, args):
target_col = None target_col = None