Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/hardware.py18
-rw-r--r--archinstall/lib/luks.py6
-rw-r--r--archinstall/lib/systemd.py16
3 files changed, 14 insertions, 26 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 3586ad09..10f3970f 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -3,9 +3,7 @@ from .general import sys_command
from .networking import list_interfaces, enrichIfaceTypes
def hasWifi():
- if 'WIRELESS' in enrichIfaceTypes(list_interfaces().values()).values():
- return True
- return False
+ return 'WIRELESS' in enrichIfaceTypes(list_interfaces().values()).values()
def hasAMDCPU():
if subprocess.check_output("lscpu | grep AMD", shell=True).strip().decode():
@@ -24,18 +22,12 @@ def graphicsDevices():
return cards
def hasNvidiaGraphics():
- if [x for x in graphicsDevices() if 'nvidia' in x]:
- return True
- return False
+ return any('nvidia' in x for x in graphicsDevices())
def hasAmdGraphics():
- if [x for x in graphicsDevices() if 'amd' in x]:
- return True
- return False
+ return any('amd' in x for x in graphicsDevices())
def hasIntelGraphics():
- if [x for x in graphicsDevices() if 'intel' in x]:
- return True
- return False
+ return any('intel' in x for x in graphicsDevices())
-# TODO: Add more identifiers \ No newline at end of file
+# TODO: Add more identifiers
diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py
index 19c21795..57163e35 100644
--- a/archinstall/lib/luks.py
+++ b/archinstall/lib/luks.py
@@ -94,8 +94,8 @@ class luks2():
else:
raise err
- if b'Command successful.' not in b''.join(cmd_handle):
- raise DiskError(f'Could not encrypt volume "{partition.path}": {o}')
+ if b'Command successful.' not in (cmd_output := b''.join(cmd_handle)):
+ raise DiskError(f'Could not encrypt volume "{partition.path}": {cmd_output}')
return key_file
@@ -126,4 +126,4 @@ class luks2():
def format(self, path):
if (handle := sys_command(f"/usr/bin/cryptsetup -q -v luksErase {path}")).exit_code != 0:
- raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}') \ No newline at end of file
+ raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}')
diff --git a/archinstall/lib/systemd.py b/archinstall/lib/systemd.py
index edd75098..f2b7c9b3 100644
--- a/archinstall/lib/systemd.py
+++ b/archinstall/lib/systemd.py
@@ -26,15 +26,11 @@ class Ini():
return result
class Systemd(Ini):
- def __init__(self, *args, **kwargs):
- """
- Placeholder class to do systemd specific setups.
- """
- super(Systemd, self).__init__(*args, **kwargs)
+ """
+ Placeholder class to do systemd specific setups.
+ """
class Networkd(Systemd):
- def __init__(self, *args, **kwargs):
- """
- Placeholder class to do systemd-network specific setups.
- """
- super(Networkd, self).__init__(*args, **kwargs) \ No newline at end of file
+ """
+ Placeholder class to do systemd-network specific setups.
+ """