Skip to content

Commit 6eb3fa9

Browse files
committed
Added both links to changelog to get both of best worlds.
1 parent b1c2f89 commit 6eb3fa9

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

command_line.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff 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:

files/settings.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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']"""

0 commit comments

Comments
 (0)