From a5b0a567dfade96a07c8b8360c03719ac2a557b9 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Sat, 23 Sep 2017 10:58:27 +0300 Subject: [PATCH] refactoring --- pylgbst/constants.py | 8 +++++-- pylgbst/movehub.py | 18 +++++++-------- pylgbst/peripherals.py | 52 ++++++++++++++++++++---------------------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/pylgbst/constants.py b/pylgbst/constants.py index 0ba66c3..1fd5f7d 100644 --- a/pylgbst/constants.py +++ b/pylgbst/constants.py @@ -10,14 +10,18 @@ else: queue = queue # just to use it -def str2hex(data): # TODO: eliminate it +def str2hex(data): return binascii.hexlify(data).decode("utf8") -def get_byte(seq, index): +def usbyte(seq, index): return struct.unpack("