Merge pull request #134 from conqp/master

General code cleanup
This commit is contained in:
Anton Hvornum 2021-04-02 09:01:07 +00:00 committed by GitHub
commit 0488c93a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 23 deletions

View File

@ -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 hasUEFI():
return os.path.isdir('/sys/firmware/efi')
@ -19,18 +17,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
# TODO: Add more identifiers

View File

@ -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)
"""
Placeholder class to do systemd-network specific setups.
"""