From abb76d7ac48377192b020730f35713c87c1d2d55 Mon Sep 17 00:00:00 2001 From: Arturo Hernandez Date: Wed, 2 May 2018 18:18:05 -0400 Subject: [PATCH] fixed test_voice for python3 --- test_voice.py | 20 ++++++++++---------- zk/base.py | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test_voice.py b/test_voice.py index 106ba73..293c3c8 100755 --- a/test_voice.py +++ b/test_voice.py @@ -16,28 +16,28 @@ parser.add_argument('-T', '--timeout', type=int, help='timeout [60]', default=60) parser.add_argument('-P', '--password', type=int, help='Device code/password', default=0) -parser.add_argument('-f', '--firmware', type=int, - help='test firmware', default=8) +parser.add_argument('-f', '--force-udp', action="store_true", + help='Force UDP communication') args = parser.parse_args() conn = None -zk = ZK(args.address, port=args.port, timeout=args.timeout, password=args.password, firmware=args.firmware) +zk = ZK(args.address, port=args.port, timeout=args.timeout, password=args.password, force_udp=args.force_udp) try: - print 'Connecting to device ...' + print ('Connecting to device ...') conn = zk.connect() - print 'Disabling device ...' + print ('Disabling device ...') conn.disable_device() - print 'Firmware Version: : {}'.format(conn.get_firmware_version()) + print ('Firmware Version: : {}'.format(conn.get_firmware_version())) for i in range(0,65): - print "test_voice, %i" % i + print ("test_voice, %i" % i) zk.test_voice(i) sleep(3) - print 'Enabling device ...' + print ('Enabling device ...') conn.enable_device() -except Exception, e: - print "Process terminate : {}".format(e) +except Exception as e: + print ("Process terminate : {}".format(e)) finally: if conn: conn.disconnect() diff --git a/zk/base.py b/zk/base.py index 89a54e2..c0814e3 100644 --- a/zk/base.py +++ b/zk/base.py @@ -663,10 +663,10 @@ class ZK(object): 7 memoria de alm fich llena /- 8 huella duplicada / huella duplicada 9 acceso denegado / ya ha sido registrado - 10 *beep* / beep - 11 el sistema vuelve al modo de verificacion / beep + 10 *beep* / beep kuko + 11 el sistema vuelve al modo de verificacion / beep siren 12 por favor coloque su dedo o acerque tarjeta /- - 13 acerca su tarjeta de nuevo /beep + 13 acerca su tarjeta de nuevo /beep bell 14 excedido tiempo p esta operacion /- 15 coloque su dedo de nuevo /- 16 coloque su dedo por ultima vez /-