diff --git a/.bin/Scripts/functions/common.py b/.bin/Scripts/functions/common.py index 492a1adb..050205e7 100644 --- a/.bin/Scripts/functions/common.py +++ b/.bin/Scripts/functions/common.py @@ -470,7 +470,12 @@ def stay_awake(): def get_exception(s): """Get exception by name, returns Exception object.""" - return getattr(sys.modules[__name__], s) + try: + obj = getattr(sys.modules[__name__], s) + except AttributeError: + # Try builtin classes + obj = getattr(sys.modules['builtins'], s) + return obj def try_and_print(message='Trying...', function=None, cs='CS', ns='NS', other_results={}, diff --git a/.bin/Scripts/system_checklist.py b/.bin/Scripts/system_checklist.py index d3d6a978..e3eca0bf 100644 --- a/.bin/Scripts/system_checklist.py +++ b/.bin/Scripts/system_checklist.py @@ -26,6 +26,7 @@ if __name__ == '__main__': 'Error': { 'CalledProcessError': 'Unknown Error', 'BIOSKeyNotFoundError': 'BIOS key not found', + 'FileNotFoundError': 'Program not found', }, 'Warning': {}} print_info('Starting System Checklist for Ticket #{}\n'.format( @@ -44,20 +45,20 @@ if __name__ == '__main__': try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done') try_and_print(message='AdwCleaner...', - function=cleanup_adwcleaner, cs='Done') + function=cleanup_adwcleaner, cs='Done', other_results=other_results) # Export system info print_info('Backup System Information') try_and_print(message='AIDA64 reports...', - function=run_aida64, cs='Done') + function=run_aida64, cs='Done', other_results=other_results) try_and_print(message='File listing...', - function=backup_file_list, cs='Done') + function=backup_file_list, cs='Done', other_results=other_results) try_and_print(message='Power plans...', function=backup_power_plans, cs='Done') - try_and_print(message='Product Keys...', + try_and_print(message='Product Keys...', other_results=other_results, function=run_produkey, cs='Done') try_and_print(message='Registry...', - function=backup_registry, cs='Done') + function=backup_registry, cs='Done', other_results=other_results) # User data print_info('User Data') @@ -84,7 +85,7 @@ if __name__ == '__main__': try_and_print(message='Opening Device Manager...', function=open_device_manager, cs='Started') try_and_print(message='Opening HWiNFO (Sensors)...', - function=run_hwinfo_sensors, cs='Started') + function=run_hwinfo_sensors, cs='Started', other_results=other_results) try_and_print(message='Opening Windows Updates...', function=open_windows_updates, cs='Started') if not windows_is_activated(): @@ -92,7 +93,7 @@ if __name__ == '__main__': function=open_windows_activation, cs='Started') sleep(3) try_and_print(message='Running XMPlay...', - function=run_xmplay, cs='Started') + function=run_xmplay, cs='Started', other_results=other_results) # Done print_standard('\nDone.') diff --git a/.bin/Scripts/system_diagnostics.py b/.bin/Scripts/system_diagnostics.py index 0d10f144..3b1418d0 100644 --- a/.bin/Scripts/system_diagnostics.py +++ b/.bin/Scripts/system_diagnostics.py @@ -25,6 +25,7 @@ if __name__ == '__main__': other_results = { 'Error': { 'CalledProcessError': 'Unknown Error', + 'FileNotFoundError': 'Program not found', }, 'Warning': { 'GenericRepair': 'Repaired', @@ -38,9 +39,9 @@ if __name__ == '__main__': # try_and_print(message='Killing processes...', # function=run_process_killer, cs='Done') try_and_print(message='Running RKill...', - function=run_rkill, cs='Done') + function=run_rkill, cs='Done', other_results=other_results) try_and_print(message='Running TDSSKiller...', - function=run_tdsskiller, cs='Done') + function=run_tdsskiller, cs='Done', other_results=other_results) # Re-run if earlier process was stopped. stay_awake() @@ -49,9 +50,9 @@ if __name__ == '__main__': print_info('Starting Background Scans') check_connection() try_and_print(message='Running HitmanPro...', - function=run_hitmanpro, cs='Started') + function=run_hitmanpro, cs='Started', other_results=other_results) try_and_print(message='Running Autoruns...', - function=run_autoruns, cs='Started') + function=run_autoruns, cs='Started', other_results=other_results) # OS Health Checks print_info('OS Health Checks') @@ -70,18 +71,18 @@ if __name__ == '__main__': # Export system info print_info('Backup System Information') try_and_print(message='AIDA64 reports...', - function=run_aida64, cs='Done') + function=run_aida64, cs='Done', other_results=other_results) try_and_print(message='BleachBit report...', - function=run_bleachbit, cs='Done') + function=run_bleachbit, cs='Done', other_results=other_results) backup_browsers() try_and_print(message='File listing...', - function=backup_file_list, cs='Done') + function=backup_file_list, cs='Done', other_results=other_results) try_and_print(message='Power plans...', function=backup_power_plans, cs='Done') try_and_print(message='Product Keys...', - function=run_produkey, cs='Done') + function=run_produkey, cs='Done', other_results=other_results) try_and_print(message='Registry...', - function=backup_registry, cs='Done') + function=backup_registry, cs='Done', other_results=other_results) # Summary print_info('Summary')