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

Side by Side Diff: globals/get_browser_versions.py

Issue 29722659: Fixes #36 - Adjusted heading font-sizes and line-heights (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Patch Set: Created March 14, 2018, 1:33 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | includes/as-mentioned.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import re 1 import re
2 import os 2 import os
3 import sys 3 import sys
4 import json 4 import json
5 import urllib 5 import urllib
6 import errno 6 import errno
7 import logging 7 import logging
8 import time 8 import time
9 from xml.dom import minidom 9 from xml.dom import minidom
10 10
11 from jinja2 import contextfunction 11 from jinja2 import contextfunction
12 12
13 BROWSERS = {} 13 BROWSERS = {}
14 BASE_URL = 'https://product-details.mozilla.org/1.0' 14 BASE_URL = 'https://product-details.mozilla.org/1.0'
15 FIREFOX_URL = BASE_URL + '/firefox_versions.json' 15 FIREFOX_URL = BASE_URL + '/firefox_versions.json'
16 THUNDERBIRD_URL = BASE_URL + '/thunderbird_versions.json'
17 SEAMONKEY_URL = 'http://www.seamonkey-project.org/seamonkey_versions.json'
16 CHROME_URL = 'https://omahaproxy.appspot.com/all.json?os=win' 18 CHROME_URL = 'https://omahaproxy.appspot.com/all.json?os=win'
17 19
18 cache = {} 20 cache = {}
19 21
20 22
21 def get_json_versions(product_url): 23 def get_json_versions(product_url):
22 response = urllib.urlopen(product_url) 24 response = urllib.urlopen(product_url)
23 try: 25 try:
24 doc = json.load(response) 26 doc = json.load(response)
25 except json.ValueError: 27 except json.ValueError:
(...skipping 12 matching lines...) Expand all
38 def get_firefox_versions(): 40 def get_firefox_versions():
39 versions = get_json_versions(FIREFOX_URL) 41 versions = get_json_versions(FIREFOX_URL)
40 return { 42 return {
41 'current': versions['LATEST_FIREFOX_VERSION'], 43 'current': versions['LATEST_FIREFOX_VERSION'],
42 'unreleased': [ 44 'unreleased': [
43 versions['LATEST_FIREFOX_DEVEL_VERSION'], 45 versions['LATEST_FIREFOX_DEVEL_VERSION'],
44 versions['FIREFOX_NIGHTLY'], 46 versions['FIREFOX_NIGHTLY'],
45 ] 47 ]
46 } 48 }
47 49
50
51 def get_thunderbird_versions():
52 tbird_versions = get_json_versions(THUNDERBIRD_URL)
53 firefox_versions = get_json_versions(FIREFOX_URL)
54 return {
55 'current': tbird_versions['LATEST_THUNDERBIRD_VERSION'],
56 'unreleased': [
57 tbird_versions['LATEST_THUNDERBIRD_DEVEL_VERSION'],
58 tbird_versions['LATEST_THUNDERBIRD_ALPHA_VERSION'],
59 firefox_versions['FIREFOX_NIGHTLY'],
60 ]
61 }
62
48 BROWSERS['firefox'] = lambda: get_firefox_versions() 63 BROWSERS['firefox'] = lambda: get_firefox_versions()
64 BROWSERS['thunderbird'] = lambda: get_thunderbird_versions()
65
66
67 def get_seamonkey_versions():
68 seamonkey_versions = get_json_versions(SEAMONKEY_URL)
69 versions = {
70 'current': seamonkey_versions['LATEST_SEAMONKEY_VERSION'],
71 'unreleased': [
72 seamonkey_versions['LATEST_SEAMONKEY_MILESTONE_VERSION'],
73 seamonkey_versions['LATEST_SEAMONKEY_DEVEL_VERSION'],
74 ]
75 }
76
77 return versions
78
79 BROWSERS['seamonkey'] = get_seamonkey_versions
49 80
50 81
51 def get_chrome_versions(): 82 def get_chrome_versions():
52 response = urllib.urlopen(CHROME_URL) 83 response = urllib.urlopen(CHROME_URL)
53 try: 84 try:
54 data = json.load(response) 85 data = json.load(response)
55 finally: 86 finally:
56 response.close() 87 response.close()
57 88
58 versions = { 89 versions = {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 file.seek(0) 227 file.seek(0)
197 json.dump(persistent_cache, file) 228 json.dump(persistent_cache, file)
198 file.truncate() 229 file.truncate()
199 230
200 if not versions['previous']: 231 if not versions['previous']:
201 logging.warning("Couldn't determine previous browser version, " 232 logging.warning("Couldn't determine previous browser version, "
202 'please set %s.previous in %s', browser, filename) 233 'please set %s.previous in %s', browser, filename)
203 234
204 cache[browser] = versions 235 cache[browser] = versions
205 return versions 236 return versions
OLDNEW
« no previous file with comments | « no previous file | includes/as-mentioned.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld