From 5eaefb3e4107bc34f723705fa4c5f0a79fbfdb4e Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Thu, 30 Nov 2017 13:34:39 -0800 Subject: [PATCH] Misc cleanup --- .bin/Scripts/functions/browsers.py | 4 ++-- .bin/Scripts/functions/common.py | 12 ++++++------ .bin/Scripts/functions/data.py | 7 +++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.bin/Scripts/functions/browsers.py b/.bin/Scripts/functions/browsers.py index 98073bba..20fefb97 100644 --- a/.bin/Scripts/functions/browsers.py +++ b/.bin/Scripts/functions/browsers.py @@ -7,12 +7,12 @@ browser_data = {} other_results = { 'Error': { 'MultipleInstallationsError': 'Multiple installations detected', - }, + }, 'Warning': { 'NotInstalledError': 'Not installed', 'NoProfilesError': 'No profiles found', + } } -} # Regex REGEX_BACKUP = re.compile( diff --git a/.bin/Scripts/functions/common.py b/.bin/Scripts/functions/common.py index c0899c21..5657cf39 100644 --- a/.bin/Scripts/functions/common.py +++ b/.bin/Scripts/functions/common.py @@ -308,10 +308,6 @@ def print_info(*args, **kwargs): """Prints message to screen in BLUE.""" print_standard(*args, color=COLORS['BLUE'], **kwargs) -def print_warning(*args, **kwargs): - """Prints message to screen in YELLOW.""" - print_standard(*args, color=COLORS['YELLOW'], **kwargs) - def print_standard(message='Generic info', color=None, end='\n', timestamp=True, **kwargs): """Prints message to screen and log (if set).""" @@ -326,6 +322,10 @@ def print_success(*args, **kwargs): """Prints message to screen in GREEN.""" print_standard(*args, color=COLORS['GREEN'], **kwargs) +def print_warning(*args, **kwargs): + """Prints message to screen in YELLOW.""" + print_standard(*args, color=COLORS['YELLOW'], **kwargs) + def print_log(message='', end='\n', timestamp=True): time_str = time.strftime("%Y-%m-%d %H%M%z: ") if timestamp else '' if 'LogFile' in global_vars and global_vars['LogFile'] is not None: @@ -615,8 +615,8 @@ def check_os(): def check_tools(): """Set tool variables based on OS bit-depth and tool availability.""" if global_vars['OS'].get('Arch', 32) == 64: - global_vars['Tools'] = {k: v.get('64', v.get('32')) - for (k, v) in TOOLS.items()} + global_vars['Tools'] = { + k: v.get('64', v.get('32')) for (k, v) in TOOLS.items()} else: global_vars['Tools'] = {k: v.get('32') for (k, v) in TOOLS.items()} diff --git a/.bin/Scripts/functions/data.py b/.bin/Scripts/functions/data.py index 72bb14dc..47714b9d 100644 --- a/.bin/Scripts/functions/data.py +++ b/.bin/Scripts/functions/data.py @@ -99,7 +99,7 @@ FAST_COPY_ARGS = [ '/linkdest', '/no_ui', '/auto_close', - '/exclude='+';'.join(FAST_COPY_EXCLUDES), + '/exclude={}'.format(';'.join(FAST_COPY_EXCLUDES)), ] # Code borrowed from: https://stackoverflow.com/a/29075319 SEM_NORMAL = ctypes.c_uint() @@ -165,7 +165,6 @@ def mount_backup_shares(): continue mount_network_share(server) - def mount_network_share(server): """Mount a network share defined by server.""" @@ -251,7 +250,7 @@ def scan_source(source_obj, dest_path): return selected_items def scan_source_path(source_path, dest_path, rel_path=None, interactive=True): - """Scan source folder for files/folders to transfer. + """Scan source folder for files/folders to transfer, returns list. This will scan the root and (recursively) any Windows.old folders.""" rel_path = '\\' + rel_path if rel_path else '' @@ -307,7 +306,7 @@ def scan_source_path(source_path, dest_path, rel_path=None, interactive=True): return selected_items def scan_source_wim(source_wim, dest_path, rel_path=None, interactive=True): - """Scan source WIM file for files/folders to transfer. + """Scan source WIM file for files/folders to transfer, returns list. This will scan the root and (recursively) any Windows.old folders.""" rel_path = '\\' + rel_path if rel_path else ''