wacom: treat any settings.ini misconfigurations as unregistered
This situation will never be handled correctly b a GUI and there's no need to, our settings aren't supposed to be edited by puny humans. So just log an error and treat the device as unregistered. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
fe75fc4342
commit
bad7aa4554
|
@ -260,10 +260,6 @@ class WacomTimeoutException(WacomException):
|
|||
errno = errno.ETIME
|
||||
|
||||
|
||||
class WacomCorruptDataException(WacomException):
|
||||
errno = errno.EPROTO
|
||||
|
||||
|
||||
class WacomPacket(GObject.Object):
|
||||
'''
|
||||
A single protocol packet of variable length. The protocol format is a
|
||||
|
@ -970,13 +966,10 @@ class WacomDevice(GObject.Object):
|
|||
|
||||
try:
|
||||
protocol = ProtocolVersion.from_string(self._config['Protocol'])
|
||||
except KeyError:
|
||||
raise WacomCorruptDataException(f'Missing Protocol entry from config file. Please delete config file and re-register device')
|
||||
except ValueError:
|
||||
logger.error(f'Unknown protocol in configuration: {self._config["Protocol"]}')
|
||||
raise WacomCorruptDataException(f'Unknown Protocol {self._config["Protocol"]}')
|
||||
|
||||
self._init_protocol(protocol)
|
||||
except (KeyError, ValueError):
|
||||
logger.error(f'Missing or invalid Protocol entry in config file. Treating this device as unregistered')
|
||||
self._uuid = None
|
||||
|
||||
def _init_protocol(self, protocol):
|
||||
protocols = {
|
||||
|
|
Loading…
Reference in New Issue