[Libreoffice-commits] dev-tools.git: scripts/esc-mentoring.py
jan iversen
jani at documentfoundation.org
Fri Feb 12 19:14:48 UTC 2016
scripts/esc-mentoring.py | 40 +++++++++++++++++++++++++++++++++++-----
1 file changed, 35 insertions(+), 5 deletions(-)
New commits:
commit b59a862d845d758e9aeedfed9ad43255f4183ed8
Author: jan iversen <jani at documentfoundation.org>
Date: Fri Feb 12 20:13:46 2016 +0100
mentoring tool bz/gerrit
Added retrival of gerrit open bugs.
diff --git a/scripts/esc-mentoring.py b/scripts/esc-mentoring.py
index e547674..70a701c 100644
--- a/scripts/esc-mentoring.py
+++ b/scripts/esc-mentoring.py
@@ -11,9 +11,12 @@ import sys
import csv
import io
import datetime
-from urllib.request import urlopen, URLError
+import json
+from urllib.request import urlopen, URLError
-def get_easyHacks():
+
+
+def get_easyHacks() :
url = 'https://bugs.documentfoundation.org/buglist.cgi?' \
'bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=VERIFIED&bug_status=NEEDINFO' \
'&columnlist=Cbug_id%2Cassigned_to%2Cbug_status%2Cshort_desc%2Cchangeddate%2Creporter%2Clongdescs.count%2Copendate' \
@@ -47,12 +50,37 @@ def get_easyHacks():
}
return rawList
+
+
+def get_gerrit(doNonCom) :
+ url = 'https://gerrit.libreoffice.org/changes/?' \
+ 'q=status:open'
+ if (doNonCom) :
+ url = url + '+-ownerin:committer'
+
+ # Add needed fields
+ url = url + '&o=DETAILED_LABELS&o=MESSAGES'
+ #url = url + '&o=code_review&o=reviewers&pp=0'
+
+ try:
+ resp = urlopen(url)
+ except URLError:
+ sys.stderr.write('Error fetching {}'.format(url))
+ sys.exit(1)
+
+ data = resp.read().decode('utf8')[5:]
+ rawList = json.loads(data)
+ return rawList
+
+
+
+
def formatEasy(easyHack) :
return 'https://bugs.documentfoundation.org/show_bug.cgi?id={} {}'.format(easyHack['id'], easyHack['desc'])
-def ESC_easyHacks(easyHacks) :
+def ESC_report(easyHacks) :
# prepare to count easyHacks, and list special status, new hacks (7 days)
xTot = len(easyHacks)
@@ -92,7 +120,9 @@ def ESC_easyHacks(easyHacks) :
if __name__ == '__main__':
- easyHacks = get_easyHacks()
+ easyHacks = get_easyHacks()
+ gerritOpen = get_gerrit(False)
+ gerritNonCommiter = get_gerrit(True)
- ESC_easyHacks(easyHacks)
+ ESC_report(easyHacks)
More information about the Libreoffice-commits
mailing list