From 5d40d74c4620fcd39cf6de1d6685da4ac01ae207 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 6 Aug 2019 21:10:13 -0600 Subject: [PATCH] Include sys.argv in debug report --- scripts/wk/std.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/wk/std.py b/scripts/wk/std.py index 7e67cdd4..a7755bc5 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -175,25 +175,22 @@ def get_log_filepath(): def generate_debug_report(): """Generate debug report with various runtime details, returns str.""" import socket - report = [] - func_list = ( + platform_function_list = ( 'architecture', 'machine', 'platform', 'python_version', ) + report = [] - # Platform - report.append('[Platform]') - report.append(' {:<24} {}'.format( - 'FQDN', - socket.getfqdn(), - )) - for func in func_list: - report.append(' {:<24} {}'.format( - func.replace('_', ' ').title(), - getattr(platform, func)(), - )) + # System + report.append('[System]') + report.append(' {:<24} {}'.format('FQDN', socket.getfqdn())) + for func in platform_function_list: + func_name = func.replace('_', ' ').capitalize() + func_result = getattr(platform, func)() + report.append(' {:<24} {}'.format(func_name, func_result)) + report.append(' {:<24} {}'.format('Python sys.argv', sys.argv)) report.append('') # Environment