From 7e55f9bcd8d597fab4334a703dc1c26f48b2df64 Mon Sep 17 00:00:00 2001 From: "Fanani M. Ihsan" Date: Fri, 17 Jun 2016 13:31:24 +0700 Subject: [PATCH] fixing indentation --- zk/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zk/base.py b/zk/base.py index b0e0e8d..796dd1e 100644 --- a/zk/base.py +++ b/zk/base.py @@ -22,7 +22,7 @@ class ZK(object): ''' Puts a the parts that make up a packet together and packs them into a byte string ''' - buf = pack('HHHH', command, checksum, session_id, reply_id) + command_string + buf = pack('HHHH', command, checksum, session_id, reply_id) + command_string buf = unpack('8B'+'%sB' % len(command_string), buf) checksum = unpack('H', self.__create_checksum(buf))[0] reply_id += 1 @@ -47,12 +47,12 @@ class ZK(object): l -= 2 if l: checksum = checksum + p[-1] - + while checksum > const.USHRT_MAX: checksum -= const.USHRT_MAX - + checksum = ~checksum - + while checksum < 0: checksum += const.USHRT_MAX