-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathface_pay.py
More file actions
66 lines (46 loc) · 1.18 KB
/
face_pay.py
File metadata and controls
66 lines (46 loc) · 1.18 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import logging
from random import randint
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger("flask_ask").setLevel(logging.DEBUG)
global state
global numItemsScanned
@ask.launch
def new_game():
global state
state = 0
return question(render_template('welcome'))
@ask.intent("YesIntent")
def useYes():
global state
if state == 0:
state = 1
return question(render_template('user'))
elif state == 1:
state = 2
return question(render_template('exist'))
elif state == 2:
state = 3
return question(render_template('scan'))
@ask.intent("AnswerIntent", convert={'num': int})
def numItems(num):
global state
if state == 2:
return statement(render_template('scan', num=num))
numItemsScanned = num
return question(render_template('quit'))
@ask.intent("NoIntent")
def useNo():
global state
if state == 0:
return question(render_template('nocout'))
elif state == 1:
return question(render_template('register'))
return question(render_template('quit'))
# @ask.intent("StopIntent")
# def quitFunct():
# return
if __name__ == '__main__':
app.run(debug=True)