Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
KHY_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Graduate
2020-06-04 22:42:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a709637cc5e245edd0000bc220d3c47bc8fae07
2a709637
1 parent
29eccbac
Modify server.py
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
server/server.py
server/server.py
View file @
2a70963
...
...
@@ -151,9 +151,11 @@ async def thread(websocket, path):
# TODO: lecture DB에 tuple 삽입해야 아래 코드가 돌아감
# 해당하는 사람이 DB에 있으면 출석 처리
#date = datetime.now().strftime('%Y-%m-%d')
#sql = "INSERT INTO student_attendance(lecture_id, student_id, date, status) VALUES (%s, %s, %s, %s)"
#cursor.execute(sql, ('0', verified_id, date, 'attend'))
# 테이블 맨 뒤에 datetime attribute가 있음. 서버 시간 가져오게 default로 설정해둠.
#sql = "INSERT INTO student_attendance(lecture_id, student_id, status) VALUES (%s, %s, %s, %s)"
# TODO: attend / late 처리
#cursor.execute(sql, ('0', verified_id, 'attend'))
# client에 전달
send
=
json
.
dumps
({
'status'
:
'success'
,
'student_id'
:
verified_id
})
...
...
@@ -166,12 +168,13 @@ async def thread(websocket, path):
arr
=
np
.
asarray
(
data
[
'image'
],
dtype
=
np
.
uint8
)
blob
=
arr
.
tobytes
()
date
=
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
'
)
#datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S
')
# TODO: lecture DB에 tuple 삽입해야 아래 코드가 돌아감
# 테이블 맨 뒤에 datetime attribute가 있음. 서버 시간 가져오게 default로 설정해둠.
#cursor = attendance_db.cursor(pymysql.cursors.DictCursor)
#sql = "INSERT INTO undefined_image(lecture_id, date, image, width, height) VALUES (%s, %s, _binary %s, %s, %s)"
#cursor.execute(sql, ('0', date, blob, arr.shape[0], arr.shape[1]))
#sql = "INSERT INTO undefined_image(lecture_id, date
time
, image, width, height) VALUES (%s, %s, _binary %s, %s, %s)"
#cursor.execute(sql, ('0', date
time
, blob, arr.shape[0], arr.shape[1]))
#attendance_db.commit()
else
:
print
(
"unsupported event: {}"
,
data
)
...
...
Please
register
or
login
to post a comment