Updated data.py
This commit is contained in:
parent
c74e2c7667
commit
4049272cbb
1 changed files with 769 additions and 767 deletions
|
|
@ -40,7 +40,7 @@ REGEX_EXCL_ROOT_ITEMS = re.compile(
|
|||
r'^(boot(mgr|nxt)$|Config.msi'
|
||||
r'|(eula|globdata|install|vc_?red)'
|
||||
r'|.*.sys$|System Volume Information|RECYCLER?|\$Recycle\.bin'
|
||||
r'|\$?Win(dows(.old.*|\.~BT|)$|RE_)|\$GetCurrent|Windows10Upgrade'
|
||||
r'|\$?Win(dows(.old.*|\. BT|)$|RE_)|\$GetCurrent|Windows10Upgrade'
|
||||
r'|PerfLogs|Program Files|SYSTEM.SAV'
|
||||
r'|.*\.(esd|swm|wim|dd|map|dmg|image)$)',
|
||||
re.IGNORECASE)
|
||||
|
|
@ -238,8 +238,8 @@ def get_mounted_volumes():
|
|||
cmd = [
|
||||
'findmnt', '-J', '-b', '-i',
|
||||
'-t', (
|
||||
'autofs,binfmt_misc,bpf,cgroup,cgroup2,configfs,debugfs,devpts,devtmpfs,'
|
||||
'hugetlbfs,mqueue,proc,pstore,securityfs,sysfs,tmpfs'
|
||||
'autofs,binfmt_misc,bpf,cgroup,cgroup2,configfs,debugfs,devpts,'
|
||||
'devtmpfs,hugetlbfs,mqueue,proc,pstore,securityfs,sysfs,tmpfs'
|
||||
),
|
||||
'-o', 'SOURCE,TARGET,FSTYPE,LABEL,SIZE,AVAIL,USED']
|
||||
result = run_program(cmd)
|
||||
|
|
@ -453,7 +453,7 @@ def run_wimextract(source, items, dest):
|
|||
run_program(cmd)
|
||||
|
||||
def list_source_items(source_obj, rel_path=None):
|
||||
"""List items in a dir or WIM, returns a list of SourceItem objects."""
|
||||
"""List items in a dir or WIM, returns list of SourceItem objects."""
|
||||
items = []
|
||||
rel_path = '{}{}'.format(os.sep, rel_path) if rel_path else ''
|
||||
if source_obj.is_dir():
|
||||
|
|
@ -573,7 +573,7 @@ def scan_source(source_obj, dest_path, rel_path='', interactive=True):
|
|||
return selected_items
|
||||
|
||||
def get_source_item_obj(source_obj, rel_path, item_path):
|
||||
"""Check if the item exists and return a SourceItem object if it does."""
|
||||
"""Check if the item exists, returns SourceItem object or None."""
|
||||
item_obj = None
|
||||
item_path = fix_path_sep(item_path)
|
||||
if source_obj.is_dir():
|
||||
|
|
@ -628,7 +628,7 @@ def select_destination(folder_path, prompt='Select destination'):
|
|||
return path
|
||||
|
||||
def select_source(backup_prefix):
|
||||
"""Select backup from those found on the BACKUP_SERVERS matching the prefix."""
|
||||
"""Select matching backup from BACKUP_SERVERS, returns obj."""
|
||||
selected_source = None
|
||||
local_sources = []
|
||||
remote_sources = []
|
||||
|
|
@ -832,7 +832,7 @@ def select_volume(title='Select disk', auto_select=True):
|
|||
def set_thread_error_mode(silent=True):
|
||||
"""Disable or Enable Windows error message dialogs.
|
||||
|
||||
Disable when scanning for disks to avoid popups for empty cardreaders, etc
|
||||
Disable when scanning disks to avoid popups for empty cardreaders, etc
|
||||
"""
|
||||
# Code borrowed from: https://stackoverflow.com/a/29075319
|
||||
kernel32 = ctypes.WinDLL('kernel32')
|
||||
|
|
@ -884,3 +884,5 @@ def umount_network_share(server):
|
|||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
|
||||
# vim: sts=2 sw=2 ts=2
|
||||
|
|
|
|||
Loading…
Reference in a new issue