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: Addressed comments Created May 22, 2014, 8:21 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 | no next file » | 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
@@ -425,6 +428,7 @@
info["fullApplication"] = "%s %s" % (info["application"], info["applicationVersion"])
if "platform" in info:
info["fullPlatform"] = "%s %s" % (info["platform"], info["platformVersion"])
+
Felix Dahlke 2014/05/22 08:30:38 Unrelated whitespace change?
Sebastian Noack 2014/05/22 08:40:39 Done.
return info
def add_record(info, section, ignore_fields=()):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld