Updated the test and tested with local ztk
This commit is contained in:
parent
392910d3df
commit
f72e2e9952
@ -1,3 +0,0 @@
|
|||||||
uFace 800 (zkteco)
|
|
||||||
connected sucessfully
|
|
||||||
worked with finger and face
|
|
15
api.py
Normal file
15
api.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import flask
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
sys.path.insert(1,os.path.abspath("./zk"))
|
||||||
|
from zk import ZK, const
|
||||||
|
|
||||||
|
app = flask.Flask(__name__)
|
||||||
|
app.config["DEBUG"] = True
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/', methods=['GET'])
|
||||||
|
def home():
|
||||||
|
return "<h1>Distant Reading Archive</h1><p>This site is a prototype API for distant reading of science fiction novels.</p>"
|
||||||
|
|
||||||
|
app.run()
|
@ -8,9 +8,8 @@ sys.path.append(ROOT_DIR)
|
|||||||
|
|
||||||
from zk import ZK
|
from zk import ZK
|
||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
zk = ZK('192.168.2.201', port=4370)
|
zk = ZK('192.168.0.240', port=4370, password="123")
|
||||||
try:
|
try:
|
||||||
conn = zk.connect()
|
conn = zk.connect()
|
||||||
print ("-- Device Information --")
|
print ("-- Device Information --")
|
||||||
|
@ -10,7 +10,7 @@ from zk import ZK, const
|
|||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
zk = ZK('192.168.2.201', port=4370)
|
zk = ZK('192.168.0.240', port=4370, password="123")
|
||||||
try:
|
try:
|
||||||
conn = zk.connect()
|
conn = zk.connect()
|
||||||
print ('Disabling device ...')
|
print ('Disabling device ...')
|
||||||
|
@ -10,7 +10,7 @@ from zk import ZK
|
|||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
zk = ZK('192.168.2.201', port=4370)
|
zk = ZK('192.168.0.240', port=4370, password="123")
|
||||||
try:
|
try:
|
||||||
conn = zk.connect()
|
conn = zk.connect()
|
||||||
for attendance in conn.live_capture():
|
for attendance in conn.live_capture():
|
||||||
|
@ -11,7 +11,7 @@ from zk import ZK
|
|||||||
|
|
||||||
|
|
||||||
conn = None
|
conn = None
|
||||||
zk = ZK('192.168.2.201', port=4370)
|
zk = ZK('192.168.0.240', port=4370, password="123")
|
||||||
try:
|
try:
|
||||||
conn = zk.connect()
|
conn = zk.connect()
|
||||||
for i in range(0, 55):
|
for i in range(0, 55):
|
||||||
|
@ -1569,6 +1569,7 @@ class ZK(object):
|
|||||||
record_size = total_size/self.records
|
record_size = total_size/self.records
|
||||||
if self.verbose: print ("record_size is ", record_size)
|
if self.verbose: print ("record_size is ", record_size)
|
||||||
attendance_data = attendance_data[4:]
|
attendance_data = attendance_data[4:]
|
||||||
|
|
||||||
if record_size == 8:
|
if record_size == 8:
|
||||||
while len(attendance_data) >= 8:
|
while len(attendance_data) >= 8:
|
||||||
uid, status, timestamp, punch = unpack('HB4sB', attendance_data.ljust(8, b'\x00')[:8])
|
uid, status, timestamp, punch = unpack('HB4sB', attendance_data.ljust(8, b'\x00')[:8])
|
||||||
|
Loading…
Reference in New Issue
Block a user