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

Unified Diff: sitescripts/extensions/utils.py

Issue 29364443: Issue 4653 - Add handling for bookmarks to readMetadata (Closed)
Patch Set: Created Nov. 25, 2016, 1:34 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/utils.py
===================================================================
--- a/sitescripts/extensions/utils.py
+++ b/sitescripts/extensions/utils.py
@@ -178,17 +178,17 @@
self.nightlyConfig.add_section(self.repositoryName)
def __str__(self):
"""
Provides a string representation of this configuration
"""
return self.repositoryName
- def readMetadata(self, version='tip'):
+ def readMetadata(self, version):
genericFilename = 'metadata'
filename = '%s.%s' % (genericFilename, self.type)
files = subprocess.check_output(['hg', '-R', self.repository,
'locate', '-r', version]).splitlines()
if filename not in files:
# some repositories like those for Android and
# Internet Explorer don't have metadata files
@@ -202,17 +202,17 @@
result = subprocess.check_output(command)
parser = SafeConfigParser()
parser.readfp(StringIO(result))
return parser
def getDownloads(self):
- metadata = self.readMetadata()
+ metadata = self.readMetadata(self.revision)
if metadata:
prefix = metadata.get('general', 'basename')
else:
prefix = os.path.basename(os.path.normpath(self.repository))
prefix += '-'
command = ['hg', 'locate', '-R', self.downloadsRepo, '-r', 'default']
for filename in subprocess.check_output(command).splitlines():
@@ -311,16 +311,18 @@
def getDownloadLinks(result):
"""
gets the download links for all extensions and puts them into the config
object
"""
for repo in Configuration.getRepositoryConfigurations():
try:
(downloadURL, version) = _getDownloadLink(repo)
+ if downloadURL is None:
+ raise Exception('No download link found for repo: ' + repo)
except:
traceback.print_exc()
continue
if not result.has_section(repo.repositoryName):
result.add_section(repo.repositoryName)
result.set(repo.repositoryName, 'downloadURL', downloadURL)
result.set(repo.repositoryName, 'version', version)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld