Skip to content

Commit 30cd5db

Browse files
committed
Fix #161: Add new page to search for nw.js versions
1 parent 58ba7b4 commit 30cd5db

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

command_line.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ def get_versions(self):
282282

283283
current_branch = self.get_default_nwjs_branch()
284284

285-
for url in self.settings['version_info']['urls']:
285+
for urlTuple in self.settings['version_info']['urls']:
286+
url, regex = urlTuple
286287
url = url.format(current_branch)
287288
response = request.urlopen(url)
288289
html = response.read().decode('utf-8')
@@ -291,7 +292,7 @@ def get_versions(self):
291292

292293
old_versions = set(nw_version.values)
293294
old_versions = old_versions.union(union_versions)
294-
new_versions = set(re.findall('(\S+) / \d{2}-\d{2}-\d{4}', html))
295+
new_versions = set(re.findall(regex, html))
295296

296297
union_versions = old_versions.union(new_versions)
297298

files/settings.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,5 @@ linux_64_dir_prefix = 'nwjs-v{}-linux-x64'
319319
'force_download']"""
320320

321321
[version_info]
322-
urls="""['https://raw.githubusercontent.com/nwjs/nw.js/{}/CHANGELOG.md']"""
322+
urls="""[('https://raw.githubusercontent.com/nwjs/nw.js/{}/CHANGELOG.md', '(\S+) / \d{2}-\d{2}-\d{4}'), ('http://nwjs.io/blog/', 'NW.js v(\S+) ')]"""
323323
github_api_url="https://api.github.com/repos/nwjs/nw.js"

0 commit comments

Comments
 (0)