mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-01-19 12:40:52 +00:00
parent
375fb4f14f
commit
aa418aba20
13
README.rst
13
README.rst
@ -24,7 +24,6 @@ Contents
|
||||
* `Check AUR <#check-aur>`_
|
||||
* `Check GitHub <#check-github>`_
|
||||
* `Check BitBucket <#check-bitbucket>`_
|
||||
* `Check GitCafe <#check-gitcafe>`_
|
||||
* `Check GitLab <#check-gitlab>`_
|
||||
* `Check PyPI <#check-pypi>`_
|
||||
* `Check RubyGems <#check-rubygems>`_
|
||||
@ -223,18 +222,6 @@ sort_version_key
|
||||
``vercmp``. Default value is ``parse_version``. ``parse_version`` use
|
||||
``pkg_resources.parse_version``. ``vercmp`` use ``pyalpm.vercmp``.
|
||||
|
||||
Check GitCafe
|
||||
-------------
|
||||
Check `GitCafe <https://gitcafe.com/>`_ for updates. The version returned is in date format ``%Y%m%d``, e.g. ``20130701``.
|
||||
|
||||
gitcafe
|
||||
The gitcafe repository, with author, e.g. ``Deepin/deepin-music``.
|
||||
|
||||
branch
|
||||
Which branch to track? Default: ``master``.
|
||||
|
||||
Anonymously only. Authorization is not supported yet.
|
||||
|
||||
Check GitLab
|
||||
-------------
|
||||
Check `GitLab <https://gitlab.com/>`_ for updates. The version returned is in date format ``%Y%m%d``, e.g. ``20130701``.
|
||||
|
@ -3,7 +3,7 @@ from importlib import import_module
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
handler_precedence = (
|
||||
'github', 'gitcafe', 'aur', 'pypi', 'archpkg', 'gems', 'pacman',
|
||||
'github', 'aur', 'pypi', 'archpkg', 'gems', 'pacman',
|
||||
'cmd', 'bitbucket', 'gcode_hg', 'gcode_svn', 'regex', 'manual', 'vcs',
|
||||
'cratesio', 'npm', 'hackage', 'cpan', 'gitlab', 'packagist'
|
||||
)
|
||||
|
@ -1,23 +0,0 @@
|
||||
import os
|
||||
import json
|
||||
import re
|
||||
from functools import partial
|
||||
|
||||
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
|
||||
|
||||
GITCAFE_URL = 'https://gitcafe.com/%s/commits/%s'
|
||||
gitcafe_pattern = re.compile(r'datetime="([^"]*)"')
|
||||
|
||||
def get_version(name, conf, callback):
|
||||
repo = conf.get('gitcafe')
|
||||
br = conf.get('branch', 'master')
|
||||
url = GITCAFE_URL % (repo, br)
|
||||
headers = {'Accept': "text/html"}
|
||||
request = HTTPRequest(url, headers=headers, user_agent='lilydjwg/nvchecker')
|
||||
AsyncHTTPClient().fetch(request, callback=partial(_gitcafe, name, callback))
|
||||
|
||||
def _gitcafe(name, callback, res):
|
||||
body = res.body.decode('utf-8')
|
||||
data = gitcafe_pattern.search(body).group(1)
|
||||
version = data.split('T', 1)[0].replace('-', '')
|
||||
callback(name, version)
|
@ -1,8 +0,0 @@
|
||||
from flaky import flaky
|
||||
from tests.helper import ExternalVersionTestCase
|
||||
|
||||
|
||||
class GitCafeTest(ExternalVersionTestCase):
|
||||
@flaky(max_runs=7)
|
||||
def test_gitcafe(self):
|
||||
self.assertEqual(self.sync_get_version("example", {"gitcafe": "test/test"}), "20120201")
|
Loading…
Reference in New Issue
Block a user