31 lines
755 B
Python
31 lines
755 B
Python
def __init__(self):
|
|
class Dst:
|
|
self.messages = []
|
|
self.checklist = {
|
|
"from": None,
|
|
"to": None,
|
|
"time": None,
|
|
"passangerCount": None,
|
|
"discountedCount": None,
|
|
"seatType": None,
|
|
"wagonType": None
|
|
}
|
|
self.history = []
|
|
|
|
def store(self, message):
|
|
self.messages.append(message)
|
|
|
|
def get_messages(self):
|
|
return self.messages
|
|
|
|
def get_next_question(self):
|
|
for key, value in self.checklist.items():
|
|
if value == None:
|
|
return key
|
|
|
|
def save_answer(self, slots):
|
|
for slot in slots:
|
|
self.checklist[slot[0]] = slot[1]
|
|
|
|
self.messages.append(slots)
|