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 os, sys, re, marshal, codecs | 18 import os, re |
19 from urlparse import urlparse | 19 from urlparse import urlparse |
20 from time import time | 20 from time import time |
21 from xml.parsers.expat import ParserCreate, ExpatError, ErrorString | 21 from xml.parsers.expat import ParserCreate, ExpatError, ErrorString |
22 from sitescripts.utils import get_config, setupStderr | 22 from sitescripts.utils import get_config, setupStderr |
23 from sitescripts.reports.utils import saveReport, get_db, executeQuery | 23 from sitescripts.reports.utils import saveReport, get_db, executeQuery |
24 import sitescripts.subscriptions.knownIssuesParser as knownIssuesParser | 24 import sitescripts.subscriptions.knownIssuesParser as knownIssuesParser |
25 | 25 |
26 reportData = None | 26 reportData = None |
27 tagStack = None | 27 tagStack = None |
28 | 28 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 reportData['warnings'][itemPath] = 'Field %s exceeded length limit a
nd was truncated' % itemPath | 272 reportData['warnings'][itemPath] = 'Field %s exceeded length limit a
nd was truncated' % itemPath |
273 elif isinstance(data[key], basestring): | 273 elif isinstance(data[key], basestring): |
274 limit = lengthRestrictions.get(keyPath, lengthRestrictions['default_string
']) | 274 limit = lengthRestrictions.get(keyPath, lengthRestrictions['default_string
']) |
275 if len(data[key]) > limit: | 275 if len(data[key]) > limit: |
276 data[key] = data[key][0:limit] + u'…' | 276 data[key] = data[key][0:limit] + u'…' |
277 reportData['warnings'][keyPath] = 'Field %s exceeded length limit and wa
s truncated' % keyPath | 277 reportData['warnings'][keyPath] = 'Field %s exceeded length limit and wa
s truncated' % keyPath |
278 | 278 |
279 if __name__ == '__main__': | 279 if __name__ == '__main__': |
280 setupStderr() | 280 setupStderr() |
281 scanReports(get_config().get('reports', 'dataPath')) | 281 scanReports(get_config().get('reports', 'dataPath')) |
OLD | NEW |