OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2014 Eyeo GmbH | 4 # Copyright (C) 2006-2014 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 13 # GNU General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 import MySQLdb, os, sys, re, marshal | 18 import sys, re |
19 from datetime import date | 19 from datetime import date |
20 from time import time | 20 from time import time |
21 from email.utils import parseaddr | 21 from email.utils import parseaddr |
22 from sitescripts.utils import get_config, setupStderr | 22 from sitescripts.utils import get_config, setupStderr |
23 from sitescripts.templateFilters import formatmime | 23 from sitescripts.templateFilters import formatmime |
24 from email.utils import formataddr | 24 from email.utils import formataddr |
25 from sitescripts.reports.utils import mailDigest, getReports, getReportSubscript
ions, calculateReportSecret, getDigestId, getDigestSecret, getUserUsefulnessScor
e | 25 from sitescripts.reports.utils import mailDigest, getReports, getReportSubscript
ions, calculateReportSecret, getDigestId, getDigestSecret, getUserUsefulnessScor
e |
26 import sitescripts.subscriptions.subscriptionParser as subscriptionParser | 26 import sitescripts.subscriptions.subscriptionParser as subscriptionParser |
27 | 27 |
28 def loadSubscriptions(): | 28 def loadSubscriptions(): |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 if interval == 'week': | 177 if interval == 'week': |
178 startTime = currentTime - 7*24*60*60 | 178 startTime = currentTime - 7*24*60*60 |
179 elif interval == 'day': | 179 elif interval == 'day': |
180 startTime = currentTime - 24*60*60 | 180 startTime = currentTime - 24*60*60 |
181 | 181 |
182 fakeSubscription = {'url': 'https://fake.adblockplus.org', 'name': get_config(
).get('reports', 'defaultSubscriptionName'), 'email': get_config().get('reports'
, 'defaultSubscriptionRecipient')} | 182 fakeSubscription = {'url': 'https://fake.adblockplus.org', 'name': get_config(
).get('reports', 'defaultSubscriptionName'), 'email': get_config().get('reports'
, 'defaultSubscriptionRecipient')} |
183 subscriptions, subscriptionList = loadSubscriptions() | 183 subscriptions, subscriptionList = loadSubscriptions() |
184 subscriptionList.append(fakeSubscription) | 184 subscriptionList.append(fakeSubscription) |
185 reports = scanReports() | 185 reports = scanReports() |
186 sendNotifications(reports) | 186 sendNotifications(reports) |
OLD | NEW |