Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/hardware.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/hardware.py')
-rw-r--r--archinstall/lib/hardware.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index d1723cde..f527b5da 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -3,7 +3,7 @@ import os
import subprocess
from typing import Optional
-from .general import sys_command
+from .general import SysCommand
from .networking import list_interfaces, enrich_iface_types
__packages__ = [
@@ -56,48 +56,48 @@ AVAILABLE_GFX_DRIVERS = {
}
-def hasWifi() -> bool:
+def has_wifi() -> bool:
return 'WIRELESS' in enrich_iface_types(list_interfaces().values()).values()
-def hasAMDCPU() -> bool:
+def has_amd_cpu() -> bool:
if subprocess.check_output("lscpu | grep AMD", shell=True).strip().decode():
return True
return False
-def hasIntelCPU() -> bool:
+def has_intel_cpu() -> bool:
if subprocess.check_output("lscpu | grep Intel", shell=True).strip().decode():
return True
return False
-def hasUEFI() -> bool:
+def has_uefi() -> bool:
return os.path.isdir('/sys/firmware/efi')
-def graphicsDevices() -> dict:
+def graphics_devices() -> dict:
cards = {}
- for line in sys_command("lspci"):
+ for line in SysCommand("lspci"):
if b' VGA ' in line:
_, identifier = line.split(b': ', 1)
cards[identifier.strip().lower().decode('UTF-8')] = line
return cards
-def hasNvidiaGraphics() -> bool:
- return any('nvidia' in x for x in graphicsDevices())
+def has_nvidia_graphics() -> bool:
+ return any('nvidia' in x for x in graphics_devices())
-def hasAmdGraphics() -> bool:
- return any('amd' in x for x in graphicsDevices())
+def has_amd_graphics() -> bool:
+ return any('amd' in x for x in graphics_devices())
-def hasIntelGraphics() -> bool:
- return any('intel' in x for x in graphicsDevices())
+def has_intel_graphics() -> bool:
+ return any('intel' in x for x in graphics_devices())
-def cpuVendor() -> Optional[str]:
+def cpu_vendor() -> Optional[str]:
cpu_info = json.loads(subprocess.check_output("lscpu -J", shell=True).decode('utf-8'))['lscpu']
for info in cpu_info:
if info.get('field', None):
@@ -106,7 +106,7 @@ def cpuVendor() -> Optional[str]:
return None
-def isVM() -> bool:
+def is_vm() -> bool:
try:
subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
return True