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

Delta Between Two Patch Sets: sitescripts/extensions/bin/createNightlies.py

Issue 6270530592178176: Issue 1144 - Generate IE update manifests (Closed)
Left Patch Set: No template for update.json, document new settings Created July 29, 2014, 3:04 p.m.
Right Patch Set: Import writeIEUpdateManifest as doWrite in the function body Created July 30, 2014, 2:22 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.example ('k') | sitescripts/extensions/bin/updateUpdateManifests.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 # 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,
(...skipping 13 matching lines...) Expand all
24 with changelogs and documentation. 24 with changelogs and documentation.
25 25
26 """ 26 """
27 27
28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib 28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib
29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct 29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct
30 from datetime import datetime 30 from datetime import datetime
31 from urllib import urlencode 31 from urllib import urlencode
32 from xml.dom.minidom import parse as parseXml 32 from xml.dom.minidom import parse as parseXml
33 from sitescripts.utils import get_config, setupStderr, get_template 33 from sitescripts.utils import get_config, setupStderr, get_template
34 from sitescripts.extensions.utils import ( 34 from sitescripts.extensions.utils import compareVersions, Configuration, getSafa riCertificateID
35 compareVersions, Configuration, getSafariCertificateID, writeIEUpdateManifest)
36 35
37 MAX_BUILDS = 50 36 MAX_BUILDS = 50
38 37
39 38
40 class NightlyBuild(object): 39 class NightlyBuild(object):
41 """ 40 """
42 Performs the build process for an extension, 41 Performs the build process for an extension,
43 generating changelogs and documentation. 42 generating changelogs and documentation.
44 """ 43 """
45 44
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 Writes update.json file for the latest IE build 212 Writes update.json file for the latest IE build
214 """ 213 """
215 if len(versions) == 0: 214 if len(versions) == 0:
216 return 215 return
217 216
218 version = versions[0] 217 version = versions[0]
219 packageName = self.basename + '-' + version + self.config.packageSuffix 218 packageName = self.basename + '-' + version + self.config.packageSuffix
220 updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + packageName + '?update') 219 updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + packageName + '?update')
221 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) 220 baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
222 manifestPath = os.path.join(baseDir, 'update.json') 221 manifestPath = os.path.join(baseDir, 'update.json')
223 writeIEUpdateManifest(manifestPath, [{ 222
Felix Dahlke 2014/07/29 15:10:27 Not brilliant that this function has the same name
Wladimir Palant 2014/07/30 14:02:23 Don't import the function globally but only in thi
Felix Dahlke 2014/07/30 14:22:36 Yeah, I like that. Done.
223 from sitescripts.extensions.utils import writeIEUpdateManifest as doWrite
224 doWrite(manifestPath, [{
224 'basename': self.basename, 225 'basename': self.basename,
225 'version': version, 226 'version': version,
226 'updateURL': updateURL 227 'updateURL': updateURL
227 }]) 228 }])
228 229
229 for suffix in (self.config.packageSuffix, self.config.packageSuffix.replace( "-x64", "-x86")): 230 for suffix in (self.config.packageSuffix, self.config.packageSuffix.replace( "-x64", "-x86")):
230 linkPath = os.path.join(baseDir, '00latest%s' % suffix) 231 linkPath = os.path.join(baseDir, '00latest%s' % suffix)
231 outputPath = os.path.join(baseDir, self.basename + '-' + version + suffix) 232 outputPath = os.path.join(baseDir, self.basename + '-' + version + suffix)
232 if hasattr(os, 'symlink'): 233 if hasattr(os, 'symlink'):
233 if os.path.exists(linkPath): 234 if os.path.exists(linkPath):
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 except Exception, ex: 492 except Exception, ex:
492 print >>sys.stderr, "The build for %s failed:" % repo 493 print >>sys.stderr, "The build for %s failed:" % repo
493 traceback.print_exc() 494 traceback.print_exc()
494 495
495 file = open(nightlyConfigFile, 'wb') 496 file = open(nightlyConfigFile, 'wb')
496 nightlyConfig.write(file) 497 nightlyConfig.write(file)
497 498
498 499
499 if __name__ == '__main__': 500 if __name__ == '__main__':
500 main() 501 main()
LEFTRIGHT

Powered by Google App Engine
This is Rietveld