mirror of https://github.com/Desuuuu/klipper.git
t5uid1: fix Python3 errors
This commit is contained in:
parent
d1a778ee1d
commit
23e13e94a1
|
@ -47,7 +47,7 @@ class T5UID1_Var:
|
||||||
raise config.error("Invalid address '%s' in section '%s'"
|
raise config.error("Invalid address '%s' in section '%s'"
|
||||||
% (address, config.get_name()))
|
% (address, config.get_name()))
|
||||||
|
|
||||||
data_types = TYPES_LEN.keys()
|
data_types = list(TYPES_LEN.keys())
|
||||||
data_types.append('str')
|
data_types.append('str')
|
||||||
if self.type == "input":
|
if self.type == "input":
|
||||||
data_types.append('none')
|
data_types.append('none')
|
||||||
|
@ -122,7 +122,7 @@ class T5UID1_Var:
|
||||||
result = self._template.render(context)
|
result = self._template.render(context)
|
||||||
|
|
||||||
if self.data_type == "str":
|
if self.data_type == "str":
|
||||||
result = bytearray(result.replace('\n', ''))
|
result = bytearray(result.replace('\n', ''), "ascii")
|
||||||
target_len = self.data_len
|
target_len = self.data_len
|
||||||
if target_len % 2 != 0:
|
if target_len % 2 != 0:
|
||||||
target_len += 1
|
target_len += 1
|
||||||
|
|
Loading…
Reference in New Issue