protcol: just print the class name during str()
<class '....'> doesn't make things easier to debug Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
1fb36ebc40
commit
827ccbfa07
|
@ -144,7 +144,7 @@ def as_hex_string(data):
|
||||||
elif isinstance(data, list):
|
elif isinstance(data, list):
|
||||||
return ' '.join([f'{x:02x}' for x in data])
|
return ' '.join([f'{x:02x}' for x in data])
|
||||||
|
|
||||||
raise ValueError('Unsupported data format {data.__class__} for {data}')
|
raise ValueError('Unsupported data format {data.__class__.__name__} for {data}')
|
||||||
|
|
||||||
|
|
||||||
def _get_protocol_dictionary(protocol):
|
def _get_protocol_dictionary(protocol):
|
||||||
|
@ -391,7 +391,7 @@ class UnexpectedReply(ProtocolError):
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.__class__}: {self.msg}: {self.message}'
|
return f'{self.__class__.__name__}: {self.msg}: {self.message}'
|
||||||
|
|
||||||
|
|
||||||
class UnexpectedDataError(ProtocolError):
|
class UnexpectedDataError(ProtocolError):
|
||||||
|
@ -413,7 +413,7 @@ class UnexpectedDataError(ProtocolError):
|
||||||
self.bytes = bytes
|
self.bytes = bytes
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.__class__}: {self.bytes} - {self.message}'
|
return f'{self.__class__.__name__}: {self.bytes} - {self.message}'
|
||||||
|
|
||||||
|
|
||||||
class DeviceError(ProtocolError):
|
class DeviceError(ProtocolError):
|
||||||
|
@ -563,7 +563,7 @@ class Msg(object):
|
||||||
return self # allow chaining
|
return self # allow chaining
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.__class__}: {self.interaction} - {self.request} → {self.reply}'
|
return f'{self.__class__.__name__}: {self.interaction} - {self.request} → {self.reply}'
|
||||||
|
|
||||||
|
|
||||||
class MsgConnectIntuosPro(Msg):
|
class MsgConnectIntuosPro(Msg):
|
||||||
|
|
Loading…
Reference in New Issue