changes to make ks start and give the no support error in python 3.7

This commit is contained in:
Alfredo Monclus
2024-05-29 22:26:38 -03:00
parent 3fd370eafc
commit 5619a77d6e
3 changed files with 12 additions and 6 deletions

View File

@@ -40,7 +40,8 @@ try:
onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p):
if onoff := struct.unpack('B', onoff_p.raw)[0]:
onoff = struct.unpack('B', onoff_p.raw)[0]
if onoff:
state = struct.unpack('H', state_p.raw)[0]
libXext.XCloseDisplay(display)
return state
@@ -72,7 +73,8 @@ def get_wireless_interfaces():
return None
interfaces = []
for line in result:
if match := re.search('^(\\S+)\\s+.*$', line):
match = re.search('^(\\S+)\\s+.*$', line)
if match:
interfaces.append(match[1])
return interfaces