From 150a72bbeeeadd04b83146abe5bd27c679df4871 Mon Sep 17 00:00:00 2001 From: Zach Oglesby Date: Aug 30 2016 00:53:44 +0000 Subject: First commit of ticket reporting tool --- diff --git a/tools/docs-pagure.py b/tools/docs-pagure.py new file mode 100644 index 0000000..8161f1f --- /dev/null +++ b/tools/docs-pagure.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +# docs-pagure Get status of docs tickets from an array or repos +# Copyright (c) 2016 Zach Oglesby +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +import json, requests + +def grabber(project, status): + url = "https://pagure.io/api/0/"+ project + "/issues?status=" + status + "" + response = requests.get(url) + js = json.loads(response.text) + print ('== ' + status + ' issues for ' + project) + print ('*Total issues: ' + str(js['total_issues']) + '*' + '\n') + + for issue in js['issues']: + print ('=== Issue #' + str(issue['id']) + '\n') + print ('Title: ' + issue['title'] + '\n') + print ('Link: https://pagure.io/' + project + '/issue/' + str(issue['id']) + '\n') + print ('\n') + return + +print ('= Docs Pagure Tickets \n') + +projects = ["docs-fp-o", "install-guide", "fedora-cookbook", "documentation-guide", + "release-notes", "system-administrators-guide", "virt-getting-started-guide", + "multiboot-guide", "networking-guide"] + +for project in projects: + grabber(project, "Open")