Index: globals/get_browser_versions.py |
=================================================================== |
--- a/globals/get_browser_versions.py |
+++ b/globals/get_browser_versions.py |
@@ -25,77 +25,74 @@ |
<app appid="{4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D}" ap="x64-dev-multi-chrome"> |
<updatecheck/> |
</app> |
</request>''' |
cache = {} |
-def get_mozilla_version(product, origin_version, channel, |
- minor=False, subdomain='aus4', origin_build='-', |
- attribute='appVersion', platform='WINNT_x86-msvc'): |
- response = urllib.urlopen('https://%s.mozilla.org/update/3/%s/%s/%s/%s/en-US/%s/-/default/default/update.xml?force=1' % ( |
- subdomain, |
- product, |
- origin_version, |
- origin_build, |
- platform, |
- channel |
- )) |
+def get_json_versions(product): |
+ urls = { |
+ 'Firefox': |
+ 'https://product-details.mozilla.org/firefox_versions.json', |
Wladimir Palant
2016/08/12 11:40:55
Gotta love it - the URL changed into https://produ
Jon Sonesen
2016/08/16 02:27:54
will update :D
|
+ 'Thunderbird': |
+ 'https://product-details.mozilla.org/thunderbird_versions.json', |
+ 'Seamonkey': |
+ 'http://www.seamonkey-project.org/seamonkey_versions.json' |
+ } |
+ response = urllib.urlopen(urls[product]) |
try: |
- doc = minidom.parse(response) |
+ doc = json.load(response.read()) |
finally: |
response.close() |
- |
- updates = doc.getElementsByTagName('update') |
- if not updates: |
- raise Exception('No updates for %s in %s channel' % (product, channel)) |
- full_version = updates[0].getAttribute(attribute) |
- |
- match = re.search(r'^(\d+)(?:\.\d+)?', full_version) |
- if minor: |
- return match.group(0) |
- return match.group(1) |
+ return doc |
-def get_mozilla_versions(product, origin_version, release_minor=False): |
+def get_firefox_versions(): |
+ versions = get_json_versions('Firefox') |
return { |
- 'current': get_mozilla_version(product, origin_version, 'release', release_minor), |
+ 'current': versions['LATEST_FIREFOX_VERSION'], |
+ 'unreleased': [ |
+ versions['LATEST_FIREFOX_DEVEL_VERSION'], |
+ versions['FIREFOX_AURORA'], |
+ versions['FIREFOX_NIGHTLY'], |
Wladimir Palant
2016/08/12 11:40:55
We need to remove the "a1" and similar suffixes fr
Jon Sonesen
2016/08/16 02:27:54
Just to clarify; do you mean that I should remove
Wladimir Palant
2016/08/16 10:40:17
The code you are replacing here was using r'^(\d+)
Jon Sonesen
2016/08/16 18:46:09
Thank you, also I added a log statement in case th
|
+ ] |
+ } |
+ |
+ |
+def get_thunderbird_versions(): |
+ versions = get_json_versions('Thunderbird') |
+ firefox_versions = get_json_versions('Firefox') |
+ return { |
+ 'current': versions['LATEST_THUNDERBIRD_VERSION'], |
'unreleased': [ |
- get_mozilla_version(product, origin_version, 'beta'), |
- get_mozilla_version(product, origin_version, 'aurora'), |
- get_mozilla_version(product, origin_version, 'nightly'), |
+ versions['LATEST_THUNDERBIRD_DEVEL_VERSION'], |
+ firefox_versions['FIREFOX_AURORA'], |
+ firefox_versions['FIREFOX_NIGHTLY'], |
Wladimir Palant
2016/08/12 11:40:55
There is LATEST_THUNDERBIRD_ALPHA_VERSION in the d
Jon Sonesen
2016/08/16 02:27:54
Will use that instead.
|
] |
} |
-BROWSERS['firefox'] = lambda: get_mozilla_versions('Firefox', '37.0') |
-BROWSERS['thunderbird'] = lambda: get_mozilla_versions('Thunderbird', '31.0', True) |
- |
- |
-def get_seamonkey_version(origin_version, origin_build, channel, **kw): |
- return get_mozilla_version('SeaMonkey', origin_version, channel, True, |
- 'aus2-community', origin_build, 'version', **kw) |
+BROWSERS['firefox'] = lambda: get_firefox_versions() |
+BROWSERS['thunderbird'] = lambda: get_thunderbird_versions() |
def get_seamonkey_versions(): |
- versions = { |
- 'current': get_seamonkey_version('2.32', '20150112201917', 'release'), |
- 'unreleased': [get_seamonkey_version('2.32', '20150101215737', 'beta')] |
- } |
- |
# Aurora and Nightly builds for Windows are permantently broken. |
# Occasionally, builds for other platforms are broken as well. |
# https://bugzilla.mozilla.org/show_bug.cgi?id=1086553 |
Wladimir Palant
2016/08/12 11:40:55
This comment no longer makes sense, it doesn't mat
|
- for channel in ('aurora', 'nightly'): |
- try: |
- version = get_seamonkey_version('2.32', '-', channel, platform='Linux_x86-gcc3') |
- except Exception: |
- continue |
- versions['unreleased'].append(version) |
+ seamonkey_versions = get_json_versions('Seamonkey') |
+ versions = { |
+ 'current': seamonkey_versions['LATEST_SEAMONKEY_VERSION'], |
+ 'unreleased': [ |
+ seamonkey_versions['LATEST_SEAMONKEY_DEVEL_VERSION'], |
Wladimir Palant
2016/08/12 11:40:55
This should be the last entry in the list since it
|
+ seamonkey_versions['LATEST_SEAMONKEY_MILESTONE_VERSION'], |
+ seamonkey_versions['LATEST_SEAMONKEY_TESTING_VERSION'], |
+ ] |
+ } |
return versions |
BROWSERS['seamonkey'] = get_seamonkey_versions |
def get_chrome_version(manifest): |
return manifest.getAttribute('version').split('.')[0] |