Created
July 7, 2014 22:10
-
-
Save davelester/c86e3bd0081b814670c5 to your computer and use it in GitHub Desktop.
Review board tools script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rbtools.api.client import RBClient | |
client = RBClient('http://reviews.apache.org/') | |
root = client.get_root() | |
# Arguments to pass to get_review_requests() | |
# counts_only=True | |
# status | |
# to_groups | |
# max_results | |
# time_added_from | |
# time_added_to | |
reviews = root.get_review_requests(count_only=True, status="submitted", to_groups="mesos", max_results=200, time_added_from="2013-07-01", time_added_to="2013-08-01") | |
print reviews | |
contributors = dict() | |
print "_______ REVIEW ACTIVITY ________" | |
for review in reviews: | |
submitter = review.get_submitter() | |
print "(" + review.status + ") " + review.summary | |
if hasattr(submitter, 'email'): | |
if contributors.has_key(submitter.email): | |
# update the list of contribute review summaries | |
listOfContributors = contributors[submitter.email] | |
listOfContributors.append(review.summary) | |
contributors[submitter.email] = listOfContributors | |
else: | |
contributors[submitter.email] = [review.summary] | |
print "_______ ACTIVITY DIGEST ________" | |
# print contributor | |
numOfContributions = dict() | |
for c in contributors: | |
print c, len(contributors[c]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment