File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -391,19 +391,28 @@ def enable_ui_after_error(self):
391391 def get_versions (self ):
392392 if self .logger is not None :
393393 self .logger .info ('Getting versions...' )
394- response = urllib2 .urlopen (self .settings ['version_info' ]['url' ])
395- html = response .read ()
396394
397- nw_version = self .get_setting ('nw_version' )
395+ union_versions = set ()
396+
397+ for url in self .settings ['version_info' ]['urls' ]:
398+ response = urllib2 .urlopen (url )
399+ html = response .read ()
398400
399- old_versions = set (nw_version .values )
400- new_versions = set (re .findall ('(\S+) / \S+' , html ))
401+ nw_version = self .get_setting ('nw_version' )
401402
402- union_versions = list (old_versions .union (new_versions ))
403+ old_versions = set (nw_version .values )
404+ old_versions = old_versions .union (union_versions )
405+ new_versions = set (re .findall ('(\S+) / \S+' , html ))
406+
407+ union_versions = old_versions .union (new_versions )
403408
404409 versions = sorted (union_versions ,
405410 key = Version , reverse = True )
406411
412+ if len (versions ) > 19 :
413+ #Cut off old versions
414+ versions = versions [:- 19 ]
415+
407416 nw_version .values = versions
408417 f = None
409418 try :
Original file line number Diff line number Diff line change @@ -367,4 +367,4 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64'
367367 'force_download']" " "
368368
369369[version_info]
370- url = ' https://raw.githubusercontent.com/nwjs/nw.js/nw13/CHANGELOG.md'
370+ urls = " " " [ 'https://raw.githubusercontent.com/nwjs/nw.js/nw13/CHANGELOG.md', 'https://raw.githubusercontent.com/nwjs/nw.js/master/CHANGELOG.md'] " " "
You can’t perform that action at this time.
0 commit comments