Created
December 22, 2011 21:40
-
-
Save rhelmer/1511982 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/socorro/cron/ftpscraper.py b/socorro/cron/ftpscraper.py | |
| index 6ce10e8..7ba9167 100644 | |
| --- a/socorro/cron/ftpscraper.py | |
| +++ b/socorro/cron/ftpscraper.py | |
| @@ -73,21 +73,28 @@ def getNightly(dirname, url, urllib=urllib2, backfill_date=None): | |
| info_files = getLinks(nightly_url, endswith='.txt', urllib=urllib) | |
| for f in info_files: | |
| + pv = None | |
| + platform = None | |
| if 'en-US' in f: | |
| (pv, platform) = f.strip('.txt').split('.en-US.') | |
| - product = pv.split('-')[:-1] | |
| - version = pv.split('-')[-1] | |
| - repository = [] | |
| + elif 'multi' in f: | |
| + (pv, platform) = f.strip('.txt').split('.multi.') | |
| + else: | |
| + return | |
| - for field in dirname.split('-'): | |
| - if not field.isdigit(): | |
| - repository.append(field) | |
| - repository = '-'.join(repository).strip('/') | |
| + product = pv.split('-')[:-1] | |
| + version = pv.split('-')[-1] | |
| + repository = [] | |
| - info_url = '%s/%s' % (nightly_url, f) | |
| - kvpairs = parseInfoFile(info_url, nightly=True) | |
| + for field in dirname.split('-'): | |
| + if not field.isdigit(): | |
| + repository.append(field) | |
| + repository = '-'.join(repository).strip('/') | |
| - yield (platform, repository, version, kvpairs) | |
| + info_url = '%s/%s' % (nightly_url, f) | |
| + kvpairs = parseInfoFile(info_url, nightly=True) | |
| + | |
| + yield (platform, repository, version, kvpairs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment