add branch support for GitHub source

This commit is contained in:
lilydjwg 2014-09-14 16:23:36 +08:00
parent fbd046af34
commit 73b9f1bb1b
3 changed files with 7 additions and 2 deletions

View File

@ -112,6 +112,9 @@ Check `GitHub <https://github.com/>`_ for updates. The version returned is in da
github
The github repository, with author, e.g. ``lilydjwg/nvchecker``.
branch
Which branch to track? Default: ``master``.
Check PyPI
----------
Check `PyPI <https://pypi.python.org/>`_ for updates.

View File

@ -3,11 +3,12 @@ from functools import partial
from tornado.httpclient import AsyncHTTPClient
GITHUB_URL = 'https://api.github.com/repos/%s/commits'
GITHUB_URL = 'https://api.github.com/repos/%s/commits?sha=%s'
def get_version(name, conf, callback):
repo = conf.get('github')
url = GITHUB_URL % repo
br = conf.get('branch', 'master')
url = GITHUB_URL % (repo, br)
AsyncHTTPClient().fetch(url, user_agent='lilydjwg/nvchecker',
callback=partial(_github_done, name, callback))

View File

@ -59,6 +59,7 @@ regex = svgwrite-([\d.]+).zip
[you-get-git]
github = soimort/you-get
branch = develop
[ssed]
url = http://sed.sourceforge.net/grabbag/ssed/