add module delete user

This commit is contained in:
Fanani M. Ihsan 2016-06-11 13:58:49 +07:00
parent 21c685e8c5
commit ac51194f57

View File

@ -280,6 +280,23 @@ class ZK(object):
else:
raise ZKErrorResponse("Invalid response")
def delete_user(self, uid):
command = const.CMD_DELETE_USER
uid = chr(uid % 256) + chr(uid >> 8)
command_string = pack('2s', uid)
checksum = 0
session_id = self.__sesion_id
reply_id = self.__reply_id
response_size = 1024
cmd_response = self.__send_command(command, command_string, checksum, session_id, reply_id, response_size)
if cmd_response.get('status'):
return True
else:
raise ZKErrorResponse("Invalid response")
def get_users(self):
'''
get all users