From 73b9f1bb1b9d8da8a441b4160310b986b5e0d8f3 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sun, 14 Sep 2014 16:23:36 +0800 Subject: [PATCH] add branch support for GitHub source --- README.rst | 3 +++ nvchecker/source/github.py | 5 +++-- sources/arch_aur.ini | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 339e10c..49ddb30 100644 --- a/README.rst +++ b/README.rst @@ -112,6 +112,9 @@ Check `GitHub `_ 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 `_ for updates. diff --git a/nvchecker/source/github.py b/nvchecker/source/github.py index 814afb4..7e2bdda 100644 --- a/nvchecker/source/github.py +++ b/nvchecker/source/github.py @@ -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)) diff --git a/sources/arch_aur.ini b/sources/arch_aur.ini index 20f0ce5..d351461 100644 --- a/sources/arch_aur.ini +++ b/sources/arch_aur.ini @@ -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/