Simplify boolean checks
This commit is contained in:
parent
2c90f02b6b
commit
1d54a625f4
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue