Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download only with the major number #670

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions mozdownload/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,20 +709,21 @@ def get_build_info(self):

def query_versions(self, version=None):
"""Check specified version and resolve special values."""
if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS:
return [version]

url = urljoin(self.base_url, 'releases/')
parser = self._create_directory_parser(url)
if version:
versions = parser.filter(latest_version_filter(version, self.application))
import mozilla_version
MozVersion = getattr(mozilla_version, APPLICATIONS_TO_VERSION_CLASS[self.application])
versions.sort(key=MozVersion.parse)
return [versions[-1]]
else:

if not version:
return parser.entries

if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS:
versions = parser.filter(version)
else:
versions = parser.filter(latest_version_filter(version, self.application))
import mozilla_version
MozVersion = getattr(mozilla_version, APPLICATIONS_TO_VERSION_CLASS[self.application])
versions.sort(key=MozVersion.parse)
return [versions[-1]]


class ReleaseCandidateScraper(ReleaseScraper):
"""Class to download a release candidate build of a Gecko based application."""
Expand Down