forked from CITGuru/PyInquirer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rawlist.py
36 lines (31 loc) · 909 Bytes
/
rawlist.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
# -*- coding: utf-8 -*-
"""
* example for rawlist question type
* run example by typing `python example/rawlist.py` in your console
"""
from __future__ import print_function, unicode_literals
from PyInquirer import prompt, print_json, Separator
from examples import custom_style_2
questions = [
{
'type': 'rawlist',
'name': 'theme',
'message': 'What do you want to do?',
'choices': [
'Order a pizza',
'Make a reservation',
Separator(),
'Ask opening hours',
'Talk to the receptionist'
]
},
{
'type': 'rawlist',
'name': 'size',
'message': 'What size do you need',
'choices': ['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'],
'filter': lambda val: val.lower()
}
]
answers = prompt.prompt(questions, style=custom_style_2)
print_json(answers)