Skip to content

Commit

Permalink
removed blank lines in battery info
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpleWazard committed May 6, 2024
1 parent 4425c32 commit 397ab2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions auto_cpufreq/battery_scripts/ideapad_acpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def ideapad_acpi_print_thresholds():
battery_count = len([name for name in os.listdir(
"/sys/class/power_supply/") if name.startswith('BAT')])
print("\n-------------------------------- Battery Info ---------------------------------\n")
print(f"battery count = {battery_count}\n")
print(f"battery count = {battery_count}")
for b in range(battery_count):
try:
with open(f'/sys/class/power_supply/BAT{b}/charge_start_threshold', 'r') as f:
print(f'battery{b} start threshold = {f.read()}')
print(f'battery{b} start threshold = {f.read()}', end="")
f.close()

with open(f'/sys/class/power_supply/BAT{b}/charge_stop_threshold', 'r') as f:
print(f'battery{b} stop threshold = {f.read()}')
print(f'battery{b} stop threshold = {f.read()}', end="")
f.close()

except Exception:
Expand Down
6 changes: 3 additions & 3 deletions auto_cpufreq/battery_scripts/ideapad_laptop.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ def ideapad_laptop_print_thresholds():
battery_count = len([name for name in os.listdir(
"/sys/class/power_supply/") if name.startswith('BAT')])
print("\n-------------------------------- Battery Info ---------------------------------\n")
print(f"battery count = {battery_count}\n")
print(f"battery count = {battery_count}")
for b in range(battery_count):
try:
with open(f'/sys/class/power_supply/BAT{b}/charge_start_threshold', 'r') as f:
print(f'battery{b} start threshold = {f.read()}')
print(f'battery{b} start threshold = {f.read()}', end="")
f.close()

with open(f'/sys/class/power_supply/BAT{b}/charge_stop_threshold', 'r') as f:
print(f'battery{b} stop threshold = {f.read()}')
print(f'battery{b} stop threshold = {f.read()}', end="")
f.close()

except Exception:
Expand Down
6 changes: 3 additions & 3 deletions auto_cpufreq/battery_scripts/thinkpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def thinkpad_print_thresholds():
battery_count = len([name for name in os.listdir(
"/sys/class/power_supply/") if name.startswith('BAT')])
print("\n-------------------------------- Battery Info ---------------------------------\n")
print(f"battery count = {battery_count}\n")
print(f"battery count = {battery_count}")
for b in range(battery_count):
try:
with open(f'/sys/class/power_supply/BAT{b}/charge_start_threshold', 'r') as f:
print(f'battery{b} start threshold = {f.read()}')
print(f'battery{b} start threshold = {f.read()}', end="")
f.close()

with open(f'/sys/class/power_supply/BAT{b}/charge_stop_threshold', 'r') as f:
print(f'battery{b} stop threshold = {f.read()}')
print(f'battery{b} stop threshold = {f.read()}', end="")
f.close()

except Exception:
Expand Down

0 comments on commit 397ab2c

Please sign in to comment.