From 87cd994b0477e98c976e7b321b3c1f52666ab5e0 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 2 Jan 2018 14:40:00 -0800 Subject: Upgrade yapf to 0.20.0 Upgrade yapf version to 0.20.0 and reformat Python files. --- tools/github/pr_latency.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'tools/github') diff --git a/tools/github/pr_latency.py b/tools/github/pr_latency.py index 0131e60bbc..34870a5326 100644 --- a/tools/github/pr_latency.py +++ b/tools/github/pr_latency.py @@ -72,9 +72,13 @@ def output(pr, errors)) elif mode == 'csv': print(','.join([ - str(pr), str(base_time), str(test_time), str( - int((test_time - base_time).total_seconds())), str(successes), - str(failures), str(errors) + str(pr), + str(base_time), + str(test_time), + str(int((test_time - base_time).total_seconds())), + str(successes), + str(failures), + str(errors) ])) @@ -117,8 +121,7 @@ def get_status_data(statuses_url, system): if system == 'kokoro': string_in_target_url = 'kokoro' elif system == 'jenkins': string_in_target_url = 'grpc-testing' for status in statuses['statuses']: - if not status['target_url'] or string_in_target_url not in status[ - 'target_url']: + if not status['target_url'] or string_in_target_url not in status['target_url']: continue # Ignore jenkins if status['state'] == 'pending': return None elif status['state'] == 'success': successes += 1 @@ -130,8 +133,8 @@ def get_status_data(statuses_url, system): latest_datetime = max(latest_datetime, parse_timestamp(status['updated_at'])) # First status is the most recent one. - if any([successes, failures, errors]) and sum( - [successes, failures, errors]) > 15: + if any([successes, failures, errors + ]) and sum([successes, failures, errors]) > 15: return { 'latest_datetime': latest_datetime, 'successes': successes, -- cgit v1.2.3