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

Side by Side Diff: sitescripts/extensions/bin/updateUpdateManifests.py

Issue 29756624: Noissue - Adapt best practices for trailing commas (sitescripts) (Closed)
Patch Set: Re-run script on Python 2, added flake8-commas extension Created April 19, 2018, 2:35 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 | « sitescripts/extensions/bin/updateRecommendations.py ('k') | sitescripts/extensions/utils.py » ('j') | 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 """ 50 """
51 if repo.type == 'android': 51 if repo.type == 'android':
52 command = ['hg', '-R', repo.repository, 'id', '-r', version, '-n'] 52 command = ['hg', '-R', repo.repository, 'id', '-r', version, '-n']
53 result = subprocess.check_output(command) 53 result = subprocess.check_output(command)
54 revision = re.sub(r'\D', '', result) 54 revision = re.sub(r'\D', '', result)
55 55
56 return { 56 return {
57 'revision': revision, 57 'revision': revision,
58 'version': version, 58 'version': version,
59 'minSdkVersion': get_min_sdk_version(repo, version), 59 'minSdkVersion': get_min_sdk_version(repo, version),
60 'basename': os.path.basename(repo.repository) 60 'basename': os.path.basename(repo.repository),
61 } 61 }
62 elif repo.type == 'safari': 62 elif repo.type == 'safari':
63 metadata = repo.readMetadata(version) 63 metadata = repo.readMetadata(version)
64 certs = read_certificates_and_key(repo.keyFile)[0] 64 certs = read_certificates_and_key(repo.keyFile)[0]
65 65
66 return { 66 return {
67 'certificateID': get_developer_identifier(certs), 67 'certificateID': get_developer_identifier(certs),
68 'version': version, 68 'version': version,
69 'shortVersion': version, 69 'shortVersion': version,
70 'basename': metadata.get('general', 'basename'), 70 'basename': metadata.get('general', 'basename'),
71 'updatedFromGallery': True 71 'updatedFromGallery': True,
72 } 72 }
73 elif repo.type == 'ie': 73 elif repo.type == 'ie':
74 return { 74 return {
75 'version': version, 75 'version': version,
76 'basename': os.path.basename(repo.repository) 76 'basename': os.path.basename(repo.repository),
77 } 77 }
78 else: 78 else:
79 raise Exception('unknown repository type %r' % repo.type) 79 raise Exception('unknown repository type %r' % repo.type)
80 80
81 81
82 def writeUpdateManifest(links): 82 def writeUpdateManifest(links):
83 """ 83 """
84 writes an update manifest for all extensions and Android apps 84 writes an update manifest for all extensions and Android apps
85 """ 85 """
86 86
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 updates all update manifests with the current versions 119 updates all update manifests with the current versions
120 """ 120 """
121 121
122 parser = SafeConfigParser() 122 parser = SafeConfigParser()
123 getDownloadLinks(parser) 123 getDownloadLinks(parser)
124 writeUpdateManifest(parser) 124 writeUpdateManifest(parser)
125 125
126 126
127 if __name__ == '__main__': 127 if __name__ == '__main__':
128 updateUpdateManifests() 128 updateUpdateManifests()
OLDNEW
« no previous file with comments | « sitescripts/extensions/bin/updateRecommendations.py ('k') | sitescripts/extensions/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld