You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My locale specifies German number formatting i.e. two and a half will be "2,5" instead of "2.5".
This breaks the part of your script which is responsible for parsing the output of upower because it expects only digits and a dot in floating point number literals.
You could either prefix the upower command with LANG=C to run it with a default English locale or translate commas into dots in the output string before parsing it.
Here's the exact traceback:
$ powerflow-indicator
/usr/local/bin/powerflow-indicator:39: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
from gi.repository import AppIndicator3 as appindicator
Traceback (most recent call last):
File "/usr/local/bin/powerflow-indicator", line 172, in <module>
main()
File "/usr/local/bin/powerflow-indicator", line 168, in main
indicator = LockKeyStatusIndicator(args.amps)
File "/usr/local/bin/powerflow-indicator", line 59, in __init__
self.update_label()
File "/usr/local/bin/powerflow-indicator", line 153, in update_label
label_text = self.get_power_info()[0]
File "/usr/local/bin/powerflow-indicator", line 138, in get_power_info
1000 * float(energy_rate[:-1]) / float(voltage[:-1]), 4)
ValueError: invalid literal for float(): 17,305
The text was updated successfully, but these errors were encountered:
My locale specifies German number formatting i.e. two and a half will be "2,5" instead of "2.5".
This breaks the part of your script which is responsible for parsing the output of
upower
because it expects only digits and a dot in floating point number literals.You could either prefix the
upower
command withLANG=C
to run it with a default English locale or translate commas into dots in the output string before parsing it.Here's the exact traceback:
The text was updated successfully, but these errors were encountered: