-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQueueGitRequist.py
49 lines (37 loc) · 1.6 KB
/
QueueGitRequist.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import json
from Round import squidgameActivity
from SquidGame import redLightGreenLight, dalgonaCookie, squidGame, tugOfWar
from RedisDBMS import updateUserScore
def addData(request):
# print(request)
request=json.loads(request)
username=request['sender']['login']
round=squidgameActivity(request)
status='None'
print(f"{username} entered {round} ")
if round==11:
score=redLightGreenLight()
status=updateUserScore(username,round,score)
print(f"{username} score update {score}, status: {status}")
return status
elif round==21:
score=dalgonaCookie(username,round,comment=(str(request['comment']['body'])).lower())
status=updateUserScore(username,round,score)
print(f"{username} score update {score}, status: {status}")
return status
elif round==22:
score=dalgonaCookie(username,round,comment=str(request['comment']['body']))
status=updateUserScore(username,round,score)
print(f"{username} score update {score}, status: {status}")
return status
elif round==31:
score=tugOfWar(request['pull_request']['additions'],request['pull_request']['changed_files'])
status=updateUserScore(username,round,score)
print(f"{username} score update {score}, status: {status}")
return status
elif round==41:
score=squidGame(str(request['pull_request']['rebaseable']))
status=updateUserScore(username,round,score)
print(f"{username} score update {score}, status: {status}")
return status
return status