Misc cleanup
This commit is contained in:
parent
c0d80e8727
commit
5eaefb3e41
3 changed files with 11 additions and 12 deletions
|
|
@ -7,12 +7,12 @@ browser_data = {}
|
||||||
other_results = {
|
other_results = {
|
||||||
'Error': {
|
'Error': {
|
||||||
'MultipleInstallationsError': 'Multiple installations detected',
|
'MultipleInstallationsError': 'Multiple installations detected',
|
||||||
},
|
},
|
||||||
'Warning': {
|
'Warning': {
|
||||||
'NotInstalledError': 'Not installed',
|
'NotInstalledError': 'Not installed',
|
||||||
'NoProfilesError': 'No profiles found',
|
'NoProfilesError': 'No profiles found',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
# Regex
|
# Regex
|
||||||
REGEX_BACKUP = re.compile(
|
REGEX_BACKUP = re.compile(
|
||||||
|
|
|
||||||
|
|
@ -308,10 +308,6 @@ def print_info(*args, **kwargs):
|
||||||
"""Prints message to screen in BLUE."""
|
"""Prints message to screen in BLUE."""
|
||||||
print_standard(*args, color=COLORS['BLUE'], **kwargs)
|
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',
|
def print_standard(message='Generic info',
|
||||||
color=None, end='\n', timestamp=True, **kwargs):
|
color=None, end='\n', timestamp=True, **kwargs):
|
||||||
"""Prints message to screen and log (if set)."""
|
"""Prints message to screen and log (if set)."""
|
||||||
|
|
@ -326,6 +322,10 @@ def print_success(*args, **kwargs):
|
||||||
"""Prints message to screen in GREEN."""
|
"""Prints message to screen in GREEN."""
|
||||||
print_standard(*args, color=COLORS['GREEN'], **kwargs)
|
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):
|
def print_log(message='', end='\n', timestamp=True):
|
||||||
time_str = time.strftime("%Y-%m-%d %H%M%z: ") if timestamp else ''
|
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:
|
if 'LogFile' in global_vars and global_vars['LogFile'] is not None:
|
||||||
|
|
@ -615,8 +615,8 @@ def check_os():
|
||||||
def check_tools():
|
def check_tools():
|
||||||
"""Set tool variables based on OS bit-depth and tool availability."""
|
"""Set tool variables based on OS bit-depth and tool availability."""
|
||||||
if global_vars['OS'].get('Arch', 32) == 64:
|
if global_vars['OS'].get('Arch', 32) == 64:
|
||||||
global_vars['Tools'] = {k: v.get('64', v.get('32'))
|
global_vars['Tools'] = {
|
||||||
for (k, v) in TOOLS.items()}
|
k: v.get('64', v.get('32')) for (k, v) in TOOLS.items()}
|
||||||
else:
|
else:
|
||||||
global_vars['Tools'] = {k: v.get('32') for (k, v) in TOOLS.items()}
|
global_vars['Tools'] = {k: v.get('32') for (k, v) in TOOLS.items()}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ FAST_COPY_ARGS = [
|
||||||
'/linkdest',
|
'/linkdest',
|
||||||
'/no_ui',
|
'/no_ui',
|
||||||
'/auto_close',
|
'/auto_close',
|
||||||
'/exclude='+';'.join(FAST_COPY_EXCLUDES),
|
'/exclude={}'.format(';'.join(FAST_COPY_EXCLUDES)),
|
||||||
]
|
]
|
||||||
# Code borrowed from: https://stackoverflow.com/a/29075319
|
# Code borrowed from: https://stackoverflow.com/a/29075319
|
||||||
SEM_NORMAL = ctypes.c_uint()
|
SEM_NORMAL = ctypes.c_uint()
|
||||||
|
|
@ -165,7 +165,6 @@ def mount_backup_shares():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mount_network_share(server)
|
mount_network_share(server)
|
||||||
|
|
||||||
|
|
||||||
def mount_network_share(server):
|
def mount_network_share(server):
|
||||||
"""Mount a network share defined by server."""
|
"""Mount a network share defined by server."""
|
||||||
|
|
@ -251,7 +250,7 @@ def scan_source(source_obj, dest_path):
|
||||||
return selected_items
|
return selected_items
|
||||||
|
|
||||||
def scan_source_path(source_path, dest_path, rel_path=None, interactive=True):
|
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."""
|
This will scan the root and (recursively) any Windows.old folders."""
|
||||||
rel_path = '\\' + rel_path if rel_path else ''
|
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
|
return selected_items
|
||||||
|
|
||||||
def scan_source_wim(source_wim, dest_path, rel_path=None, interactive=True):
|
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."""
|
This will scan the root and (recursively) any Windows.old folders."""
|
||||||
rel_path = '\\' + rel_path if rel_path else ''
|
rel_path = '\\' + rel_path if rel_path else ''
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue