minor fix
This commit is contained in:
parent
f6d9cc2887
commit
362a0b91be
24
zk/base.py
24
zk/base.py
@ -89,6 +89,18 @@ class ZK(object):
|
||||
def __receive_packet(self, buf_size):
|
||||
self.__data_recv = self.__sock.recv(buf_size)
|
||||
|
||||
def __get_data_size(self):
|
||||
"""Checks a returned packet to see if it returned CMD_PREPARE_DATA,
|
||||
indicating that data packets are to be sent
|
||||
|
||||
Returns the amount of bytes that are going to be sent"""
|
||||
response = self.__response
|
||||
if response == const.CMD_PREPARE_DATA:
|
||||
size = unpack('I', self.__data_recv[8:12])[0]
|
||||
return size
|
||||
else:
|
||||
return 0
|
||||
|
||||
@property
|
||||
def __response(self):
|
||||
'''
|
||||
@ -237,18 +249,6 @@ class ZK(object):
|
||||
else:
|
||||
return cmd_response
|
||||
|
||||
def __get_data_size(self):
|
||||
"""Checks a returned packet to see if it returned CMD_PREPARE_DATA,
|
||||
indicating that data packets are to be sent
|
||||
|
||||
Returns the amount of bytes that are going to be sent"""
|
||||
response = self.__response
|
||||
if response == const.CMD_PREPARE_DATA:
|
||||
size = unpack('I', self.__data_recv[8:12])[0]
|
||||
return size
|
||||
else:
|
||||
return 0
|
||||
|
||||
def get_users(self):
|
||||
'''
|
||||
get all users
|
||||
|
Loading…
Reference in New Issue
Block a user