aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik/message.py
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-05-05 12:26:24 +0200
committerneodarz <neodarz@neodarz.net>2019-05-05 12:26:26 +0200
commitcce51d8a961cb5b6af21cd44b357defc39e1b008 (patch)
tree7315619675f5b7e402069c12160f9d2fc0bfa386 /parrot_zik/message.py
parent3f8786741afa17c30e23186c465fe870b2de9efe (diff)
downloadpyParrotZikTCP-cce51d8a961cb5b6af21cd44b357defc39e1b008.tar.xz
pyParrotZikTCP-cce51d8a961cb5b6af21cd44b357defc39e1b008.zip
Make code compatible with python3 with python2 support
Warning: This is a preparation work for completly remove PyGTK. Because PyGTK is python2 only, most part of the code didn't work. But a last commands send to the headset is fonctional (This is why all this change).
Diffstat (limited to 'parrot_zik/message.py')
-rw-r--r--parrot_zik/message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/parrot_zik/message.py b/parrot_zik/message.py
index 214b6f9..822e057 100644
--- a/parrot_zik/message.py
+++ b/parrot_zik/message.py
@@ -11,14 +11,14 @@ class Message:
def request(self):
message = bytearray()
message.extend(self.header)
- message.extend(bytearray(self.request_string))
+ message.extend(bytearray(self.request_string, 'utf-8'))
return message
@property
def header(self):
header = bytearray([0])
header.append(len(self.request_string) + 3)
- header.append("\x80")
+ header.append(0x80)
return header
@property