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

Delta Between Two Patch Sets: globals/get_browser_versions.py

Issue 29348818: issue 4087 - Use Mozilla's product-details data to determine current product versions (Closed)
Left Patch Set: addresses concerns for maintainability, and redundancies Created Aug. 29, 2016, 2:53 p.m.
Right Patch Set: fixed problems with commas and long line...sorry for the mistake Created Aug. 30, 2016, 9:14 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 FIREFOX_URL = 'https://product-details.mozilla.org/1.0/firefox_versions.json', 14 BASE_URL = 'https://product-details.mozilla.org/1.0'
Vasily Kuznetsov 2016/08/29 17:27:52 The comma in the end is not only redundant, it act
15 THUNDERBIRD_URL = 'https://product-details.mozilla.org/1.0/thunderbird_versions. json', 15 FIREFOX_URL = BASE_URL + '/firefox_versions.json'
Vasily Kuznetsov 2016/08/29 17:27:52 This line is too long according to our guidelines
16 THUNDERBIRD_URL = BASE_URL + '/thunderbird_versions.json'
16 SEAMONKEY_URL = 'http://www.seamonkey-project.org/seamonkey_versions.json' 17 SEAMONKEY_URL = 'http://www.seamonkey-project.org/seamonkey_versions.json'
17 18
18 CHROME_UPDATE_XML = '''\ 19 CHROME_UPDATE_XML = '''\
19 <?xml version="1.0" encoding="UTF-8"?> 20 <?xml version="1.0" encoding="UTF-8"?>
20 <request protocol="3.0" ismachine="0"> 21 <request protocol="3.0" ismachine="0">
21 <os platform="win" version="99" arch="x64"/> 22 <os platform="win" version="99" arch="x64"/>
22 <app appid="{4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D}"> 23 <app appid="{4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D}">
23 <updatecheck/> 24 <updatecheck/>
24 </app> 25 </app>
25 <app appid="{4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D}" ap="x64-beta-multi-chrome" > 26 <app appid="{4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D}" ap="x64-beta-multi-chrome" >
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 file.seek(0) 243 file.seek(0)
243 json.dump(persistent_cache, file) 244 json.dump(persistent_cache, file)
244 file.truncate() 245 file.truncate()
245 246
246 if not versions['previous']: 247 if not versions['previous']:
247 logging.warning("Couldn't determine previous browser version, " 248 logging.warning("Couldn't determine previous browser version, "
248 'please set %s.previous in %s', browser, filename) 249 'please set %s.previous in %s', browser, filename)
249 250
250 cache[browser] = versions 251 cache[browser] = versions
251 return versions 252 return versions
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld