本文整理匯總了Python中rbtools.api.client.RBClient.get_review_requests方法的典型用法代碼示例。如果您正苦於以下問題:Python RBClient.get_review_requests方法的具體用法?Python RBClient.get_review_requests怎麽用?Python RBClient.get_review_requests使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rbtools.api.client.RBClient
的用法示例。
在下文中一共展示了RBClient.get_review_requests方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: calculate_statistics
# 需要導入模塊: from rbtools.api.client import RBClient [as 別名]
# 或者: from rbtools.api.client.RBClient import get_review_requests [as 別名]
print 'name', 'review count', 'max revisions', 'min revisions', 'avg revisions', 'var revisions', 'max reviews', 'min reviews', 'avg reviews', 'var reviews', '\n'
def calculate_statistics( arr ):
if len(arr) == 0: arr=[0]
return np.max(arr), np.min(arr), np.mean(arr), np.var(arr)
def print_statistics(name, n, ucrs, urns):
print name, n, calculate_statistics(ucrs), calculate_statistics(urns)
if __name__ == '__main__':
root = RBClient('http://rb.hotel.com').get_root()
rusers = root.get_users()
print_statistics_header()
for u in resource_iterator(rusers):
uname = u['username']
ureviews = root.get_review_requests(from_user=uname,status='submitted')
ucrs = []
urns = []
n = 0
for r in resource_iterator(ureviews):
code_revisions = len(r.get_diffs())
review_numbers = len(r.get_reviews())
ucrs.append(code_revisions)
urns.append(review_numbers)
n+=1
print 'LOG ', uname, ucrs, urns, '\n'
print_statistics(uname, n, ucrs, urns)