Misc cleanup

This commit is contained in:
Alan Mason 2017-11-30 13:34:39 -08:00
parent c0d80e8727
commit 5eaefb3e41
3 changed files with 11 additions and 12 deletions

View file

@ -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(

View file

@ -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()}

View file

@ -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 ''