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

Delta Between Two Patch Sets: sitescripts/extensions/pad/__init__.py

Issue 5723465818570752: Issue 520 - Generate PAD files for download portals when updating download links (Closed)
Left Patch Set: Fixed a typo Created May 28, 2014, 2:44 p.m.
Right Patch Set: Addressed comments Created June 4, 2014, 4:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « sitescripts/extensions/bin/updateDownloadLinks.py ('k') | sitescripts/extensions/pad/language.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-2014 Eyeo GmbH 2 # Copyright (C) 2006-2014 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 @property 57 @property
58 def release_date(self): 58 def release_date(self):
59 command = ['hg', 'log', '-l', '1', self.download_filename, '--template', '{d ate}'] 59 command = ['hg', 'log', '-l', '1', self.download_filename, '--template', '{d ate}']
60 result = subprocess.check_output(command, cwd=self.repo.downloadsRepo) 60 result = subprocess.check_output(command, cwd=self.repo.downloadsRepo)
61 timestamp, offset = re.match(r'(.*)([-+].*)', result).groups() 61 timestamp, offset = re.match(r'(.*)([-+].*)', result).groups()
62 return datetime(*time.gmtime(float(timestamp) + float(offset))[:6]) 62 return datetime(*time.gmtime(float(timestamp) + float(offset))[:6])
63 63
64 @property 64 @property
65 def download_size(self): 65 def download_size(self):
66 return len(subprocess.check_output( 66 return len(subprocess.check_output(
67 ['hg', 'cat', self.download_filename], 67 ['hg', 'cat', '-r', 'tip', self.download_filename],
Wladimir Palant 2014/06/04 14:32:04 Please add |-r tip| parameters here, otherwise you
Sebastian Noack 2014/06/04 16:38:59 Done.
68 cwd=self.repo.downloadsRepo 68 cwd=self.repo.downloadsRepo
69 )) 69 ))
70 70
71 @property 71 @property
72 def browser_min_version(self): 72 def browser_min_version(self):
73 metadata = self.repo.readMetadata(self.version) 73 metadata = self.repo.readMetadata(self.version)
74 compat_option = getattr(self, 'compat_option', self.repo.type) 74 compat_option = getattr(self, 'compat_option', self.repo.type)
75 return metadata.get('compat', compat_option).split('/')[0].rstrip('.0') 75 return metadata.get('compat', compat_option).split('/')[0].rstrip('.0')
76 76
77 @property 77 @property
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 translation_files_regex = r'locales\/(?P<code>.+)\.ini$' 178 translation_files_regex = r'locales\/(?P<code>.+)\.ini$'
179 179
180 class AndroidPadFile(PadFile): 180 class AndroidPadFile(PadFile):
181 browser_name = 'Android' 181 browser_name = 'Android'
182 os_support = OS_ANDROID 182 os_support = OS_ANDROID
183 translation_files_regex = r'res\/(?:raw|values)(?:-(?P<code>.+?)|(?P<is_en>))\ /' 183 translation_files_regex = r'res\/(?:raw|values)(?:-(?P<code>.+?)|(?P<is_en>))\ /'
184 184
185 @property 185 @property
186 def browser_min_version(self): 186 def browser_min_version(self):
187 return get_min_android_version(self.repo, self.version) 187 return get_min_android_version(self.repo, self.version)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld