gui: fixes from Marek's comments
This commit is contained in:
parent
f130ec0bf3
commit
577e4b24a6
@ -125,7 +125,7 @@ class GUI(qubes.ext.Extension):
|
|||||||
@qubes.ext.handler('domain-feature-pre-set:keyboard-layout')
|
@qubes.ext.handler('domain-feature-pre-set:keyboard-layout')
|
||||||
def on_feature_pre_set(self, subject, event, feature, value, oldvalue=None):
|
def on_feature_pre_set(self, subject, event, feature, value, oldvalue=None):
|
||||||
untrusted_xkb_layout = value.split('+')
|
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")
|
raise qubes.exc.QubesValueError("Invalid number of parameters")
|
||||||
|
|
||||||
untrusted_layout = untrusted_xkb_layout[0]
|
untrusted_layout = untrusted_xkb_layout[0]
|
||||||
@ -137,7 +137,7 @@ class GUI(qubes.ext.Extension):
|
|||||||
|
|
||||||
if not untrusted_layout.isalpha():
|
if not untrusted_layout.isalpha():
|
||||||
raise qubes.exc.QubesValueError("Invalid layout provided")
|
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")
|
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")
|
raise qubes.exc.QubesValueError("Invalid options provided")
|
||||||
|
Loading…
Reference in New Issue
Block a user