From: Serge Rehbinder Date: Wed, 1 Feb 2017 10:07:48 +0000 (+0100) Subject: bug fix for log command with option --last_terminal X-Git-Tag: 5.0.0a1~38^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5500ac1a9d19906c87189d94974e1b58088fe907;p=tools%2Fsat.git bug fix for log command with option --last_terminal --- diff --git a/commands/log.py b/commands/log.py index 3dbb0e3..ed7439e 100644 --- a/commands/log.py +++ b/commands/log.py @@ -138,7 +138,6 @@ def show_last_logs(logger, config, log_dirs): def show_product_last_logs(logger, config, product_log_dir): """Show last compilation logs of a product""" - files = os.listdir(product_log_dir) # sort the files chronologically l_time_file = [] for file_n in os.listdir(product_log_dir): @@ -160,9 +159,10 @@ def show_product_last_logs(logger, config, product_log_dir): # loop till exit x = -1 while (x < 0): - x = ask_value(len(files)) + x = ask_value(len(l_time_file)) if x > 0: - log_file_path = os.path.join(product_log_dir, files[x-1]) + (__, file_name) = sorted(l_time_file)[x-1] + log_file_path = os.path.join(product_log_dir, file_name) src.system.show_in_editor(config.USER.editor, log_file_path, logger) def ask_value(nb):