42
47
self.caseAddDetail = caseAddDetail or self.addDetail
50
class OSKAlwaysEnabled(Fixture):
51
"""Enable the OSK to be shown regardless of if there is a keyboard (virtual
54
This is a workaround for bug lp:1474444
58
osk_schema = 'com.canonical.keyboard.maliit'
59
osk_show_key = 'stay-hidden'
63
self._original_value = get_gsettings_value(
70
set_gsettings_value(self.osk_schema, self.osk_show_key, 'false')
79
def get_gsettings_value(schema, key):
80
"""Return the output of gsettings get as a string or None if the call
84
command = ['/usr/bin/gsettings', 'get', schema, key]
86
output = subprocess.check_output(
88
stderr=subprocess.PIPE,
89
universal_newlines=True
91
return output.rstrip('\n')
92
except subprocess.CalledProcessError as e:
94
'Failed to get gsettings value for {schema}/{key}: {error}'.format(
95
schema=schema, key=key, error=e.output
100
def set_gsettings_value(schema, key, value):
101
command = ['/usr/bin/gsettings', 'set', schema, key, value]
103
subprocess.check_output(command, stderr=subprocess.PIPE)
104
except subprocess.CalledProcessError as e:
106
'Failed to set gsettings value {sch}/{key} to {v}: {error}'.format(
107
sch=schema, key=key, v=value, error=e.output