The main window suddenly opening when a battery is critical is very
disruptive. It can pop up on all sort of undesirable scenarios.
Rather than catch users of guard, merely show a notification that the
battery is critical.
I own the former and wanted to correct this detail which caused the wrong
model to be shown in GUI.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
* from_device_number raises an exception if no device found, rather than
returning None. So, instead of checking the result, catch the exception.
* Use Attributes.get() method instead of checking containment and using the
index operator. This is really the only correct way, see rhbz#1267584.
Effect of the changes:
Previously, if no device was found this method would raise an exception.
Now it returns None instead.
Previously this method read the value of the attribute corresponding to key
twice, once via 'key in attributes' and again when accessing the key.
Now, it just reads it the one time.
Reason for noticing all these problems:
In pyudev-0.18 the Attributes class is fixed, and no longer has the []
operator or __contains__ method or other methods which require a total
mapping. This patch fixes several bugs while simultaneously avoiding these
removed operators.
Signed-off-by: mulhern <amulhern@redhat.com>
Based on SetPoint6.65.62_32.exe and Options_2.10.73.exe (features.xml,
defaults.xml, LogiOptionsMgr.exe).
The names are based on the named next to the feature ID. For duplicates,
_2 is appended to the name.
This commands helps parsing numbers from debug prints:
strings LogiOptionsMgr.exe |
sed -nr 's/.*(Feature[0-9a-fA-F]{4})/\1 /p' | sort |
awk 'tolower(a)!=tolower($1){print"";a=$1}1;' | less -S
charging. Since the battery state is unknown when beeing recharged it
will now return "N/A".
Before it would crash becasue level was None and could not be inserted
using %d.
The assumption that the Features IDs are in increasing order does not
hold. This causes the feature check for REPROG CONTROLS (1B00) to fail,
therefore remove the micro-optimisation.
While at it, rename variables and document the functions better.
This options allows the devices list to be restricted which got removed
in:
commit 3b75b69970
Author: Daniel Pavel <daniel.pavel@gmail.com>
Date: Fri Aug 9 12:25:47 2013 +0200
merged solaar-cli functionality into main solaar binary
solaar-cli is still busted, but since it is deprecated, it's probably
fine.
Fix from e3a887f36c, this got removed
in:
commit 3b75b69970
Author: Daniel Pavel <daniel.pavel@gmail.com>
Date: Fri Aug 9 12:25:47 2013 +0200
merged solaar-cli functionality into main solaar binary