Adjusting formatting

This commit is contained in:
2Shirt 2019-04-18 20:52:47 -07:00
parent 72c0e75156
commit 19799bb1f4
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 21 additions and 2 deletions

View file

@ -54,9 +54,11 @@ if __name__ == '__main__':
confirm_selections(args) confirm_selections(args)
# Prep UFD # Prep UFD
print_info('Prep UFD')
if args['--update']: if args['--update']:
# Remove arch folder # Remove arch folder
try_and_print( try_and_print(
indent=2,
message='Removing Linux...', message='Removing Linux...',
function=remove_arch, function=remove_arch,
) )
@ -66,6 +68,7 @@ if __name__ == '__main__':
# Mount UFD # Mount UFD
try_and_print( try_and_print(
indent=2,
message='Mounting UFD...', message='Mounting UFD...',
function=mount, function=mount,
mount_source=find_first_partition(ufd_dev), mount_source=find_first_partition(ufd_dev),
@ -73,9 +76,12 @@ if __name__ == '__main__':
) )
# Copy sources # Copy sources
print_standard(' ')
print_info('Copy Sources')
for s_label, s_path in sources.items(): for s_label, s_path in sources.items():
try_and_print( try_and_print(
message='Copying {} files...'.format(s_label), indent=2,
message='Copying {}...'.format(s_label),
function=copy_source, function=copy_source,
source=s_path, source=s_path,
items=ITEMS[s_label], items=ITEMS[s_label],
@ -83,7 +89,10 @@ if __name__ == '__main__':
) )
# Update boot entries # Update boot entries
print_info('Boot Setup')
try_and_print( try_and_print(
indent=2,
message='Updating boot entries...', message='Updating boot entries...',
function=update_boot_entries, function=update_boot_entries,
boot_entries=BOOT_ENTRIES, boot_entries=BOOT_ENTRIES,
@ -94,6 +103,7 @@ if __name__ == '__main__':
# Install syslinux (to partition) # Install syslinux (to partition)
try_and_print( try_and_print(
indent=2,
message='Syslinux (partition)...', message='Syslinux (partition)...',
function=install_syslinux_to_partition, function=install_syslinux_to_partition,
partition=find_first_partition(ufd_dev), partition=find_first_partition(ufd_dev),
@ -101,6 +111,7 @@ if __name__ == '__main__':
# Unmount UFD # Unmount UFD
try_and_print( try_and_print(
indent=2,
message='Unmounting UFD...', message='Unmounting UFD...',
function=unmount, function=unmount,
mount_point='/mnt/UFD', mount_point='/mnt/UFD',
@ -108,6 +119,7 @@ if __name__ == '__main__':
# Install syslinux (to device) # Install syslinux (to device)
try_and_print( try_and_print(
indent=2,
message='Syslinux (device)...', message='Syslinux (device)...',
function=install_syslinux_to_dev, function=install_syslinux_to_dev,
ufd_dev=ufd_dev, ufd_dev=ufd_dev,
@ -115,7 +127,10 @@ if __name__ == '__main__':
) )
# Hide items # Hide items
print_standard(' ')
print_info('Final Touches')
try_and_print( try_and_print(
indent=2,
message='Hiding items...', message='Hiding items...',
function=hide_items, function=hide_items,
ufd_dev=ufd_dev, ufd_dev=ufd_dev,

View file

@ -202,7 +202,7 @@ def mount(mount_source, mount_point):
run_program(cmd) run_program(cmd)
def prep_device(dev_path, label, use_mbr=False): def prep_device(dev_path, label, use_mbr=False, indent=2):
"""Format device in preparation for applying the WizardKit components """Format device in preparation for applying the WizardKit components
This is done is four steps: This is done is four steps:
@ -214,6 +214,7 @@ def prep_device(dev_path, label, use_mbr=False):
# Zero-out first 64MB # Zero-out first 64MB
cmd = 'dd bs=4M count=16 if=/dev/zero of={}'.format(dev_path).split() cmd = 'dd bs=4M count=16 if=/dev/zero of={}'.format(dev_path).split()
try_and_print( try_and_print(
indent=indent,
message='Zeroing first 64MB...', message='Zeroing first 64MB...',
function=run_program, function=run_program,
cmd=cmd, cmd=cmd,
@ -226,6 +227,7 @@ def prep_device(dev_path, label, use_mbr=False):
'-1s' if use_mbr else '-4MiB', '-1s' if use_mbr else '-4MiB',
).split() ).split()
try_and_print( try_and_print(
indent=indent,
message='Creating partition table...', message='Creating partition table...',
function=run_program, function=run_program,
cmd=cmd, cmd=cmd,
@ -237,6 +239,7 @@ def prep_device(dev_path, label, use_mbr=False):
'boot' if use_mbr else 'legacy_boot', 'boot' if use_mbr else 'legacy_boot',
).split() ).split()
try_and_print( try_and_print(
indent=indent,
message='Setting boot flag...', message='Setting boot flag...',
function=run_program, function=run_program,
cmd=cmd, cmd=cmd,
@ -249,6 +252,7 @@ def prep_device(dev_path, label, use_mbr=False):
find_first_partition(dev_path), find_first_partition(dev_path),
] ]
try_and_print( try_and_print(
indent=indent,
message='Formatting partition...', message='Formatting partition...',
function=run_program, function=run_program,
cmd=cmd, cmd=cmd,