Unreadable properties/features will be disabled, the tool will start
even if it can access nothing or almost nothing, and errors on settings
features/properties will now be communicated to the user.
* origin/pr/172:
Say which repository caused the error in warnings
Only make qrexec calls when necessary
Squash more PyLint warnings
Decode stderr in repo qrexec calls
Fix error handling
Fix `self` being undefined when showing warnings
Only apply repo preferences when "OK" is clicked
Don't use asserts for error handling
Check that repo management succeeded
Remove unnecessary assert
Squash some PyLint warnings
Add UI for managing Qubes update repositories
Fix typo
FixesQubesOS/qubes-issues#4550
This helps in situations where the qrexec calls are forbidden; it also
prevents settings from being unintentionally changed and gives a
noticeable performance boost when the "OK" button is clicked.
Before this change, "foobar\n" on stderr would be rendered (in the
warning dialog) as "b'foobar\n'", which is ugly. Now it'll be rendered
just as "foobar", followed by an actual newline character.
Apparently Python exceptions don't take **kwargs, so we just pass a
dictionary as the second (regular) argument. While we're at it, we
pretty-print said dictionary when displaying error messages.
First of all, the method that was being called has asserts of its own,
so it's guaranteed to either succeed or crash the program with
AssertionError. Second, asserts are optimized out by the interpreter
when -O is passed. Therefore, this code is buggy because it sometimes
wouldn't be run, but we need the side effects.
Fixed dependencies, places where obsolete functions stopped working,
code fragments that started throwing warnings and an .ui file that
stopped being readable after the update.
Prior to this commit, clicking on the "OK" button in the global settings
window would cause the dom0 memory boost and minimum VM memory fields to
be saved incorrectly, due to the fact that the code calculates the
values to be saved using the "MiB" as the units (i.e., factors of
1024), whereas the code would save the corresponding string into the
qmemman configuration file with the "M" suffix (indicating factors of
1000 instead of 1024).
Due to this bug, the aforementioned fields' values would be scaled down
every time the user clicked on the "OK" button in the global settings
window. For example, if the user entered 400 and hit 'OK', opening the
global settings window again would show the value 381.
Currently it uses a workaround, manually creating a file in
/var/lib/qubes/updates; once the appropriate attribute will start working
it will be used instead.
Renamed variable from 'input' to 'input_string' and moved imports to a
better place (that is, at the beginning of the module and not inside of
a function).