Skip to content

Commit

Permalink
Fix #161: Add new page to search for nw.js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jyapayne committed Sep 26, 2016
1 parent 58ba7b4 commit 30cd5db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ def get_versions(self):

current_branch = self.get_default_nwjs_branch()

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

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

union_versions = old_versions.union(new_versions)

Expand Down
2 changes: 1 addition & 1 deletion files/settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,5 @@ linux_64_dir_prefix = 'nwjs-v{}-linux-x64'
'force_download']"""

[version_info]
urls="""['https://raw.githubusercontent.com/nwjs/nw.js/{}/CHANGELOG.md']"""
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+) ')]"""
github_api_url="https://api.github.com/repos/nwjs/nw.js"

0 comments on commit 30cd5db

Please sign in to comment.