Added a "Yes to all" option to User Data Transfer

This commit is contained in:
2Shirt 2018-01-26 18:35:05 -07:00
parent a7451f86ba
commit 30dcd8758e

View file

@ -393,11 +393,19 @@ def scan_source(source_obj, dest_path, rel_path='', interactive=True):
if not interactive: if not interactive:
print_success('Auto-Selected: {}'.format(item.path)) print_success('Auto-Selected: {}'.format(item.path))
root_items.append('{}'.format(item.path)) root_items.append('{}'.format(item.path))
elif ask('Extract: "{}{}{}" ?'.format( else:
rel_path, prompt = 'Transfer: "{}{}{}" ?'.format(
os.sep if rel_path else '', rel_path,
item.name)): os.sep if rel_path else '',
root_items.append('{}'.format(item.path)) item.name)
choices = ['Yes', 'No', 'All', 'Quit']
answer = choice(prompt=prompt, choices=choices)
if answer == 'Quit':
abort()
elif answer == 'All':
interactive = False
if answer in ['Yes', 'All']:
root_items.append('{}'.format(item.path))
if REGEX_WINDOWS_OLD.search(item.name): if REGEX_WINDOWS_OLD.search(item.name):
item.name = '{}{}{}'.format( item.name = '{}{}{}'.format(
rel_path, rel_path,