From 8a6fbf4a9a99f4ce513bbce739aac46d6ede75a7 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Thu, 20 Aug 2015 01:38:27 +0800 Subject: [PATCH] Revert "try aur4 url first" This reverts commit fd0c7d57ae1b5068ef497ce7cda413f39d000aff. AUR4 has merged into current AUR. --- nvchecker/source/aur.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/nvchecker/source/aur.py b/nvchecker/source/aur.py index 9e3bbcb..1b4401b 100644 --- a/nvchecker/source/aur.py +++ b/nvchecker/source/aur.py @@ -6,30 +6,15 @@ from tornado.httpclient import AsyncHTTPClient from tornado.escape import url_escape AUR_URL = 'https://aur.archlinux.org/rpc.php?type=info&arg=' -AUR4_URL = 'https://aur4.archlinux.org/rpc.php?type=info&arg=' logger = logging.getLogger(__name__) def get_version(name, conf, callback): aurname = conf.get('aur') or name - url4 = AUR4_URL + url_escape(aurname) - AsyncHTTPClient().fetch(url4, partial(_aur4_done, name, aurname, callback)) + url = AUR_URL + url_escape(aurname) + AsyncHTTPClient().fetch(url, partial(_aur_done, name, callback)) -def _aur4_done(name, aurname, callback, res): - if res.error: - raise res.error - - data = json.loads(res.body.decode('utf-8')) - - if not data['results']: - url = AUR_URL + url_escape(aurname) - AsyncHTTPClient().fetch(url, partial(_aur_done, name, aurname, callback)) - return - - version = data['results']['Version'] - callback(name, version) - -def _aur_done(name, aurname, callback, res): +def _aur_done(name, callback, res): if res.error: raise res.error