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

Unified Diff: sitescripts/stats/bin/logprocessor.py

Issue 5438786527821824: Issue 527 - Only process notification requests sent by our own extensions (Closed)
Patch Set: Added test case Created May 22, 2014, 8:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sitescripts/stats/test/logprocessor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/bin/logprocessor.py
===================================================================
--- a/sitescripts/stats/bin/logprocessor.py
+++ b/sitescripts/stats/bin/logprocessor.py
@@ -299,15 +299,18 @@
else:
info["downloadInterval"] = "%i hour(s)" % (diff.seconds / 3600)
- diffdays = (info["time"].date() - last_update.date()).days
- if diffdays == 0:
- info["previousDownload"] = "same day"
- elif diffdays < 30:
- info["previousDownload"] = "%i day(s)" % diffdays
- elif diffdays < 365:
- info["previousDownload"] = "%i month(s)" % (diffdays / 30)
+ if info["addonName"].startswith("adblockplus"):
+ diffdays = (info["time"].date() - last_update.date()).days
+ if diffdays == 0:
+ info["previousDownload"] = "same day"
+ elif diffdays < 30:
+ info["previousDownload"] = "%i day(s)" % diffdays
+ elif diffdays < 365:
+ info["previousDownload"] = "%i month(s)" % (diffdays / 30)
+ else:
+ info["previousDownload"] = "%i year(s)" % (diffdays / 365)
else:
- info["previousDownload"] = "%i year(s)" % (diffdays / 365)
+ info["previousDownload"] = "unknown"
if last_update.year != info["time"].year or last_update.month != info["time"].month:
info["firstInMonth"] = info["firstInDay"] = True
« no previous file with comments | « no previous file | sitescripts/stats/test/logprocessor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld