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

Side by Side Diff: sitescripts/reports/bin/updateDigests.py

Issue 29673629: Issue 6293 - Include all false positives with report digest (Closed)
Patch Set: Created Jan. 19, 2018, 1:05 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 recipients = set() 61 recipients = set()
62 reportSubscriptions = getReportSubscriptions(dbreport['guid']) 62 reportSubscriptions = getReportSubscriptions(dbreport['guid'])
63 63
64 if dbreport['type'] == 'false positive' or dbreport['type'] == 'false ne gative': 64 if dbreport['type'] == 'false positive' or dbreport['type'] == 'false ne gative':
65 for subscription in reportSubscriptions: 65 for subscription in reportSubscriptions:
66 subscriptionID = subscription.get('url', 'unknown') 66 subscriptionID = subscription.get('url', 'unknown')
67 # Send false negatives to all subscription authors, false positi ves 67 # Send false negatives to all subscription authors, false positi ves
68 # only to subscriptions with matching filters 68 # only to subscriptions with matching filters
69 if subscriptionID in subscriptions and (dbreport['type'] == 'fal se negative' or subscription.get('hasmatches', 0) > 0): 69 if subscriptionID in subscriptions:
70 name, email = parseaddr(subscriptions[subscriptionID].email) 70 name, email = parseaddr(subscriptions[subscriptionID].email)
71 if email and not email in recipients: 71 if email and not email in recipients:
72 recipients.add(email) 72 recipients.add(email)
73 emails[email].append(report) 73 emails[email].append(report)
74 report['subscriptions'].append(getSubscriptionInfo(subscript ions[subscriptionID])) 74 report['subscriptions'].append(getSubscriptionInfo(subscript ions[subscriptionID]))
75 else: 75 else:
76 for subscription in reportSubscriptions: 76 for subscription in reportSubscriptions:
77 subscriptionID = subscription.get('url', 'unknown') 77 subscriptionID = subscription.get('url', 'unknown')
78 report['subscriptions'].append(getSubscriptionInfo(subscriptions [subscriptionID])) 78 report['subscriptions'].append(getSubscriptionInfo(subscriptions [subscriptionID]))
79 recipients.add(defemail) 79 recipients.add(defemail)
(...skipping 21 matching lines...) Expand all
101 'name': subscription.name, 101 'name': subscription.name,
102 'type': subscription.type 102 'type': subscription.type
103 } 103 }
104 return sub 104 return sub
105 105
106 106
107 if __name__ == '__main__': 107 if __name__ == '__main__':
108 setupStderr() 108 setupStderr()
109 currentTime = time() 109 currentTime = time()
110 updateDigests(get_config().get('reports', 'digestPath')) 110 updateDigests(get_config().get('reports', 'digestPath'))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld