fixing indentation

This commit is contained in:
Fanani M. Ihsan 2016-06-17 13:31:24 +07:00
parent a0c0e817ad
commit 7e55f9bcd8

View File

@ -22,7 +22,7 @@ class ZK(object):
''' '''
Puts a the parts that make up a packet together and packs them into a byte string 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) buf = unpack('8B'+'%sB' % len(command_string), buf)
checksum = unpack('H', self.__create_checksum(buf))[0] checksum = unpack('H', self.__create_checksum(buf))[0]
reply_id += 1 reply_id += 1
@ -47,12 +47,12 @@ class ZK(object):
l -= 2 l -= 2
if l: if l:
checksum = checksum + p[-1] checksum = checksum + p[-1]
while checksum > const.USHRT_MAX: while checksum > const.USHRT_MAX:
checksum -= const.USHRT_MAX checksum -= const.USHRT_MAX
checksum = ~checksum checksum = ~checksum
while checksum < 0: while checksum < 0:
checksum += const.USHRT_MAX checksum += const.USHRT_MAX