Exemple #1
0
def main():
	att = Attendance()
	while True:
		result = att.get_attendance()
		timestamp, count = parse_result(result)
		append_to_file(OUTPUT_FILE, ','.join([timestamp, count]) + '\n')
		time.sleep(WAIT_INTERVAL)
Exemple #2
0
def updateattendancecontroller():
    if session.get('login'):
        attendance = Attendance(dsn=app.config['dsn'])
        attendance_id = request.form['attendance']
        operation = request.form['updateordelete']
        if str(operation) == 'update':
            new_situation = request.form['attendancecontrol']
            my_attendance = attendance.get_attendance(attendance_id)
            attendance.update_attendance(attendance_id, my_attendance[1],
                                         new_situation)
            return "Guncelleme basarili"
        else:
            attendance.delete_attendance(attendance_id)
            return "Silme basarili"
    else:
        return redirect(url_for('home_page'))
Exemple #3
0
import json

from db_interface import Database

from attendance import Attendance

attendance_system = Attendance(Database("attendance.db"))

print("***********Trying get_attendance('EMP01', '2020-04-01')*************")
print(
    json.dumps(attendance_system.get_attendance('EMP01', '2020-04-02'),
               indent=4))
print("*********************************Done*******************************\n")

print("********************Trying get_history('EMP01')*********************")
print(json.dumps(attendance_system.get_history('EMP01'), indent=4))
print("*********************************Done*******************************\n")