gui: fixes from Marek's comments

This commit is contained in:
Frédéric Pierret (fepitre) 2020-03-18 14:17:04 +01:00
parent f130ec0bf3
commit 577e4b24a6
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -125,7 +125,7 @@ class GUI(qubes.ext.Extension):
@qubes.ext.handler('domain-feature-pre-set:keyboard-layout')
def on_feature_pre_set(self, subject, event, feature, value, oldvalue=None):
untrusted_xkb_layout = value.split('+')
if not len(untrusted_xkb_layout) == 3:
if len(untrusted_xkb_layout) != 3:
raise qubes.exc.QubesValueError("Invalid number of parameters")
untrusted_layout = untrusted_xkb_layout[0]
@ -137,7 +137,7 @@ class GUI(qubes.ext.Extension):
if not untrusted_layout.isalpha():
raise qubes.exc.QubesValueError("Invalid layout provided")
if not bool(re.match(re_variant, untrusted_variant)):
if not re.match(re_variant, untrusted_variant):
raise qubes.exc.QubesValueError("Invalid variant provided")
if not bool(re.match(re_options, untrusted_options)):
if not re.match(re_options, untrusted_options):
raise qubes.exc.QubesValueError("Invalid options provided")