def zk_setuser(self, user): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.set_user(uid=int(user.id), name=str(user.name), privilege=int(user.privilege), password=str(user.password), user_id=str(user.id))
def zk_connect(self): ip = self.ip port = self.port terminal = zk.ZK(ip, port, get_terminal_timeout()) conn = terminal.connect() if conn: terminal.disable_device() self.zkconn = terminal else: raise ZKError(_('can\'t connect to terminal'))
def zk_connect(self): ip = self.ip port = self.port devicepassword = self.devicepassword deviceencoding = self.deviceencoding terminal = zk.ZK(ip, port, get_terminal_timeout(), devicepassword, False, False, False, deviceencoding) conn = terminal.connect() if conn: terminal.disable_device() self.zkconn = terminal else: raise ZKError(_('can\'t connect to terminal'))
def zk_connect(self): ip = self.ip port = self.port terminal = zk.ZK(ip, port, timeout=get_terminal_timeout(), password=self.password, force_udp=self.force_udp, ommit_ping=get_ommit_ping(), verbose=get_verbose()) conn = terminal.connect() if conn: terminal.disable_device() self.zkconn = terminal else: raise ZKError(_('can\'t connect to terminal'))
def zk_clear_attendances(self): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.clear_attendance()
def zk_get_attendances(self): if not self.zkconn: raise ZKError(_('terminal connection error')) attendances = self.zkconn.get_attendance() return attendances
def zk_clear_data(self): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.clear_data()
def zk_delete_user(self, uid): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.delete_user(uid)
def zk_voice(self): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.test_voice()
def zk_getserialnumber(self): if not self.zkconn: raise ZKError(_('terminal connection error')) sn = self.zkconn.get_serialnumber() return sn
def zk_poweroff(self): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.poweroff()
def zk_restart(self): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.restart()
def zk_disconnect(self): if not self.zkconn: raise ZKError(_('terminal connection error')) self.zkconn.enable_device() self.zkconn.disconnect()
def zk_get_users(self): if not self.zkconn: raise ZKError(_('terminal connection error')) zk_get_users = self.zkconn.get_users() return zk_get_users