Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5664623214723072: Issue 1560 - ZeroDivisionError in sitescripts.stats.bin.pagegenerator (Closed)

Created:
Nov. 12, 2014, 7:43 p.m. by Wladimir Palant
Modified:
Nov. 12, 2014, 9:12 p.m.
Reviewers:
Sebastian Noack
Visibility:
Public.

Description

Issue 1560 - ZeroDivisionError in sitescripts.stats.bin.pagegenerator

Patch Set 1 #

Total comments: 2

Patch Set 2 : Better work-around for zero divisors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -12 lines) Patch
M sitescripts/stats/bin/pagegenerator.py View 1 1 chunk +5 lines, -4 lines 0 comments Download
M sitescripts/stats/template/fileOverview.html View 1 1 chunk +2 lines, -2 lines 0 comments Download
M sitescripts/stats/template/fileStats.html View 1 1 chunk +4 lines, -4 lines 0 comments Download
M sitescripts/stats/template/main.html View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5
Wladimir Palant
Nov. 12, 2014, 7:43 p.m. (2014-11-12 19:43:04 UTC) #1
Sebastian Noack
http://codereview.adblockplus.org/5664623214723072/diff/5629499534213120/sitescripts/stats/template/fileStats.html File sitescripts/stats/template/fileStats.html (right): http://codereview.adblockplus.org/5664623214723072/diff/5629499534213120/sitescripts/stats/template/fileStats.html#newcode129 sitescripts/stats/template/fileStats.html:129: "totalhits": data.hits if data.hits != 0 else 1, If ...
Nov. 12, 2014, 8:13 p.m. (2014-11-12 20:13:58 UTC) #2
Wladimir Palant
http://codereview.adblockplus.org/5664623214723072/diff/5629499534213120/sitescripts/stats/template/fileStats.html File sitescripts/stats/template/fileStats.html (right): http://codereview.adblockplus.org/5664623214723072/diff/5629499534213120/sitescripts/stats/template/fileStats.html#newcode129 sitescripts/stats/template/fileStats.html:129: "totalhits": data.hits if data.hits != 0 else 1, On ...
Nov. 12, 2014, 8:56 p.m. (2014-11-12 20:56:36 UTC) #3
Sebastian Noack
LGTM
Nov. 12, 2014, 9:05 p.m. (2014-11-12 21:05:22 UTC) #4
Wladimir Palant
Nov. 12, 2014, 9:11 p.m. (2014-11-12 21:11:21 UTC) #5
Note that strictly speaking the items|sumhits filter is no longer necessary - it
is equivalent to items.itervalues()|sum(attribute="hits"). However, this is too
verbose and too non-trivial for my taste, I'd rather avoid code duplication
here.

Powered by Google App Engine
This is Rietveld