Repare check_output error

This commit is contained in:
Angel-Karasu 2024-07-17 12:49:50 +02:00
parent af95428d4d
commit caec0449ba
3 changed files with 6 additions and 6 deletions

View File

@ -33,6 +33,6 @@ def ideapad_acpi_print_thresholds():
print(f"battery count = {len(batteries)}")
for bat in batteries:
try:
print(bat, "start threshold =", check_output(f"cat {POWER_SUPPLY_DIR}{bat}/charge_start_threshold"))
print(bat, "stop threshold =", check_output(f"cat {POWER_SUPPLY_DIR}{bat}/charge_stop_threshold"))
print(bat, "start threshold =", check_output(["cat", POWER_SUPPLY_DIR+bat+"/charge_start_threshold"]))
print(bat, "stop threshold =", check_output(["cat", POWER_SUPPLY_DIR+bat+"/charge_stop_threshold"]))
except Exception as e: print(f"ERROR: failed to read battery {bat} thresholds:", repr(e))

View File

@ -64,6 +64,6 @@ def ideapad_laptop_print_thresholds():
print(f"battery count = {len(batteries)}")
for bat in batteries:
try:
print(bat, "start threshold =", check_output(f"cat {POWER_SUPPLY_DIR}{bat}/charge_start_threshold"))
print(bat, "stop threshold =", check_output(f"cat {POWER_SUPPLY_DIR}{bat}/charge_stop_threshold"))
print(bat, "start threshold =", check_output(["cat", POWER_SUPPLY_DIR+bat+"/charge_start_threshold"]))
print(bat, "stop threshold =", check_output(["cat", POWER_SUPPLY_DIR+bat+"/charge_stop_threshold"]))
except Exception as e: print(f"ERROR: failed to read battery {bat} thresholds:", repr(e))

View File

@ -34,6 +34,6 @@ def thinkpad_print_thresholds():
print(f"battery count = {len(batteries)}")
for bat in batteries:
try:
print(bat, "start threshold =", check_output(f"cat {POWER_SUPPLY_DIR}{bat}/charge_start_threshold"))
print(bat, "stop threshold =", check_output(f"cat {POWER_SUPPLY_DIR}{bat}/charge_stop_threshold"))
print(bat, "start threshold =", check_output(["cat", POWER_SUPPLY_DIR+bat+"/charge_start_threshold"]))
print(bat, "stop threshold =", check_output(["cat", POWER_SUPPLY_DIR+bat+"/charge_stop_threshold"]))
except Exception as e: print(f"ERROR: failed to read battery {bat} thresholds:", repr(e))