auto-cpufreq/auto_cpufreq
dementive 3f6d7a3e77
Refactor charging function (#702)
* Removed the `else` from the top level of the charging() function, the logic is the same but slightly easier to read now.

* Use os.path.exists() in the charging() function before opening the file instead of FileNotFoundError exceptions, makes the function a lot easier to read.

* Close the power_supply_type_path after reading the supply_type as it is not used later.

* Remove `else: continue` from the end of the charging() function for loop, this didn't actually do anything.

I tested the charging() function on my laptop plugged in and plugged out and it is still working as expected with these changes.
2024-05-25 17:09:54 +02:00
..
battery_scripts batteries: use actual battery name instead of index 2024-05-14 17:46:51 -05:00
bin Minor refactor: code clean-up & make it more readable (#695) 2024-05-12 16:16:40 +02:00
gui Minor refactor: code clean-up & make it more readable (#695) 2024-05-12 16:16:40 +02:00
utils Minor refactor: code clean-up & make it more readable (#695) 2024-05-12 16:16:40 +02:00
__init__.py Improved Python file structure (rename source > auto_cpufreq) #153 2021-01-21 07:55:23 +01:00
core.py Refactor charging function (#702) 2024-05-25 17:09:54 +02:00
power_helper.py Minor refactor: code clean-up & make it more readable (#695) 2024-05-12 16:16:40 +02:00
tlp_stat_parser.py Minor refactor: code clean-up & make it more readable (#695) 2024-05-12 16:16:40 +02:00