From f48ce5938252574e6873dc7ea65bc3779d5c4646 Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Fri, 11 Jan 2019 13:56:28 +0900 Subject: [PATCH] fix style --- nohang | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/nohang b/nohang index 78e7dc8..52f5821 100755 --- a/nohang +++ b/nohang @@ -35,17 +35,6 @@ psi_support = os.path.exists(psi_path) # function definition section - - -def update_stat_dict(key): - if key not in stat_dict: - stat_dict.update({key: 1}) - else: - new_value = stat_dict[key] + 1 - stat_dict.update({key: new_value}) - - - def update_stat_dict_and_print(key): if key not in stat_dict: stat_dict.update({key: 1}) @@ -58,17 +47,6 @@ def update_stat_dict_and_print(key): stats_msg += '\n- {}: {}'.format(i, stat_dict[i]) - - - - - - - - - - - def psi_mem_some_avg_total(): if psi_support: return float(rline1(psi_path).rpartition('=')[2]) @@ -707,8 +685,6 @@ def find_victim_and_send_signal(signal): print(key) update_stat_dict_and_print(key) - - print(mem_info) print(etc_info) @@ -723,8 +699,6 @@ def find_victim_and_send_signal(signal): send_result = '\033[32mOK\033[0m; response time: {} ms'.format( round(response_time * 1000)) - - # update stat_dict key = 'Send \033[35m{}\033[0m to \033[35m{}\033[0m'.format( sig_dict[signal], name) @@ -732,8 +706,6 @@ def find_victim_and_send_signal(signal): update_stat_dict_and_print(key) - - if gui_notifications: send_notify(signal, name, pid) @@ -751,7 +723,6 @@ def find_victim_and_send_signal(signal): send_result = 'no such process; response time: {} ms'.format( round(response_time * 1000)) - # update stat_dict key = 'The victim died in the search process' update_stat_dict_and_print(key) @@ -775,7 +746,6 @@ def find_victim_and_send_signal(signal): else: response_time = time() - time0 - print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') print(mem_info) victim_badness_is_too_small = 'victim badness {} < min_b' \ 'adness {}; nothing to do; response time: {} ms'.format( @@ -790,7 +760,6 @@ def find_victim_and_send_signal(signal): key = 'victim badness < min_badness' update_stat_dict_and_print(key) - stats_msg = '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\033[4mUptime: {}; corrective actions:\033[0m'.format( format_time(time() - start_time)) @@ -799,8 +768,6 @@ def find_victim_and_send_signal(signal): print(stats_msg) - - sleep_after_send_signal(signal)