From c749470102468973056247d3bab72666cd8aa27b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mon, 29 Jun 2015 12:02:57 +0200 Subject: [PATCH] Add support for pagure.io in easyfix --- roles/easyfix/gather/files/gather_easyfix.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/roles/easyfix/gather/files/gather_easyfix.py b/roles/easyfix/gather/files/gather_easyfix.py index 4511cc36d8..ee53fb5d0a 100755 --- a/roles/easyfix/gather/files/gather_easyfix.py +++ b/roles/easyfix/gather/files/gather_easyfix.py @@ -242,6 +242,25 @@ def main(): ticketobj.url = ticket['html_url'] ticketobj.status = ticket['state'] tickets.append(ticketobj) + elif project.name.startswith('pagure.io:'): + project.name = project.name.split('pagure.io:')[1] + project.url = 'https://pagure.io/%s/' % (project.name) + project.site = 'pagure.io' + url = 'https://pagure.io/api/0/%s/issues?tags=%s' % ( + project.name, project.tag) + stream = urllib2.urlopen(url) + output = stream.read() + jsonobj = json.loads(output) + if jsonobj: + for ticket in jsonobj['issues']: + ticket_num = ticket_num + 1 + ticketobj = Ticket() + ticketobj.id = ticket['id'] + ticketobj.title = ticket['title'] + ticketobj.url = 'https://pagure.io/%s/issue/%s' % ( + project.name, ticket['id']) + ticketobj.status = ticket['status'] + tickets.append(ticketobj) else: project.url = 'https://fedorahosted.org/%s/' % (project.name) project.site = 'trac'