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

Side by Side Diff: sitescripts/stats/common.py

Issue 5843385483001856: Stats processing: don`t create file names that are too long (Closed)
Patch Set: Addressed nit Created Jan. 30, 2014, 12:17 p.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 # 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-2013 Eyeo GmbH 4 # Copyright (C) 2006-2013 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 re, hashlib 18 import re
19 import hashlib
19 20
20 def filename_encode(name): 21 def filename_encode(name):
21 """ 22 """
22 This encodes any string to a valid file name while ensuring that the 23 This encodes any string to a valid file name while ensuring that the
23 original string can still be reconstructed. All characters except 0-9, A-Z, 24 original string can still be reconstructed. All characters except 0-9, A-Z,
24 the period and underscore are encoded as "-12cd" where "12cd" stands for the 25 the period and underscore are encoded as "-12cd" where "12cd" stands for the
25 hexadecimal representation of the character's ordinal. File names longer 26 hexadecimal representation of the character's ordinal. File names longer
26 than 150 characters will be still be unique but no longer reversible due to 27 than 150 characters will be still be unique but no longer reversible due to
27 file system limitations. 28 file system limitations.
28 """ 29 """
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 install_fields = [ 153 install_fields = [
153 { 154 {
154 "name": "installType", 155 "name": "installType",
155 "title": "Install types", 156 "title": "Install types",
156 "coltitle": "Install type", 157 "coltitle": "Install type",
157 }, 158 },
158 ] 159 ]
159 160
160 161
161 fields = basic_fields + downloader_fields + install_fields 162 fields = basic_fields + downloader_fields + install_fields
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