Whitespace changes

This commit is contained in:
Dylan Taylor 2021-05-15 13:59:37 -04:00
parent a75dd6ea3a
commit 3b20adb7d2
11 changed files with 31 additions and 27 deletions

View File

@ -152,6 +152,7 @@ class BlockDevice():
def flush_cache(self):
self.part_cache = OrderedDict()
class Partition():
def __init__(self, path: str, block_device: BlockDevice, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False, autodetect_filesystem=True):
if not part_id:
@ -558,6 +559,7 @@ def device_state(name, *args, **kwargs):
return
return True
# lsblk --json -l -n -o path
def all_disks(*args, **kwargs):
kwargs.setdefault("partitions", False)
@ -569,6 +571,7 @@ def all_disks(*args, **kwargs):
drives[drive['path']] = BlockDevice(drive['path'], drive)
return drives
def convert_to_gigabytes(string):
unit = string.strip()[-1]
size = float(string.strip()[:-1])
@ -580,6 +583,7 @@ def convert_to_gigabytes(string):
return size
def harddrive(size=None, model=None, fuzzy=False):
collection = all_disks()
for drive in collection:

View File

@ -83,10 +83,12 @@ class JSON(json.JSONEncoder, json.JSONDecoder):
def encode(self, obj):
return super(JSON, self).encode(self._encode(obj))
class sys_command:
"""
Stolen from archinstall_gui
"""
def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, environment_vars={}, *args, **kwargs):
kwargs.setdefault("worker_id", gen_uid())
kwargs.setdefault("emulate", False)

View File

@ -423,7 +423,6 @@ class Installer():
## blkid doesn't trigger on loopback devices really well,
## so we'll use the old manual method until we get that sorted out.
if (real_device := self.detect_encryption(root_partition)):
# TODO: We need to detect if the encrypted device is a whole disk encryption,
# or simply a partition encryption. Right now we assume it's a partition (and we always have)

View File

@ -12,5 +12,4 @@ If the PR is larger than ~20 lines, please describe it here unless described in
# Testing
Any new feature or stability improvement should be tested if possible. Please follow the test instructions at the bottom
of the README or use the ISO built on each PR.
Any new feature or stability improvement should be tested if possible. Please follow the test instructions at the bottom of the README or use the ISO built on each PR.