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

Side by Side Diff: globals/get_browser_versions.py

Issue 29317012: Issue 2681 - Fixed: Thunderbird 38 is listed twice on the requirements page (Closed)
Patch Set: Created June 15, 2015, 8:45 a.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 | no next file » | 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
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 if cached_current != current: 211 if cached_current != current:
212 previous = cached_current 212 previous = cached_current
213 else: 213 else:
214 previous = cached_versions['previous'] 214 previous = cached_versions['previous']
215 versions['previous'] = previous 215 versions['previous'] = previous
216 216
217 # Remove duplicates from unreleased versions. Occasionally, 217 # Remove duplicates from unreleased versions. Occasionally,
218 # different channels are on the same version, but we want 218 # different channels are on the same version, but we want
219 # to list each version only once. 219 # to list each version only once.
220 versions['unreleased'] = sorted( 220 versions['unreleased'] = sorted(
221 set(versions['unreleased']) - {current, previous}, 221 set(versions['unreleased']) - set(re.sub(r'(\.0*)+$', '', ver) for ver i n (current, previous) if ver),
saroyanm 2015/06/15 09:35:24 Why we always check for the re.sub(r'(\.0*) ? What
Sebastian Noack 2015/06/15 09:39:53 The beta channel will be updated to 39, before 38.
saroyanm 2015/06/15 09:55:48 LGTM
222 key=key_by_version 222 key=key_by_version
223 ) 223 )
224 224
225 versions['timestamp'] = now 225 versions['timestamp'] = now
226 persistent_cache[browser] = versions 226 persistent_cache[browser] = versions
227 file.seek(0) 227 file.seek(0)
228 json.dump(persistent_cache, file) 228 json.dump(persistent_cache, file)
229 file.truncate() 229 file.truncate()
230 230
231 if not versions['previous']: 231 if not versions['previous']:
232 logging.warning("Couldn't determine previous browser version, " 232 logging.warning("Couldn't determine previous browser version, "
233 'please set %s.previous in %s', browser, filename) 233 'please set %s.previous in %s', browser, filename)
234 234
235 cache[browser] = versions 235 cache[browser] = versions
236 return versions 236 return versions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld