-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from rizkyarlin/checkbox-hints
Add hints support for checkboxes
- Loading branch information
Showing
11 changed files
with
186 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pprint import pprint | ||
|
||
import inquirer # noqa | ||
|
||
|
||
choices_hints = { | ||
("Computers", "c"): "The really Geeky stuff", | ||
("Books", "b"): "Its just so cosy", | ||
("Science", "s"): "I want to know it all", | ||
("Nature", "n"): "Always outdoors", | ||
} | ||
|
||
questions = [ | ||
inquirer.Checkbox( | ||
"interests", message="What are you interested in?", choices=choices_hints.keys(), hints=choices_hints | ||
), | ||
] | ||
|
||
answers = inquirer.prompt(questions) | ||
|
||
pprint(answers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from pprint import pprint | ||
|
||
import inquirer # noqa | ||
|
||
choices_hints = { | ||
"Jumbo": "The biggest one we have", | ||
"Large": "If you need the extra kick", | ||
"Standard": "For your every day use", | ||
} | ||
|
||
questions = [ | ||
inquirer.List("size", message="What size do you need?", choices=choices_hints.keys(), hints=choices_hints), | ||
] | ||
|
||
answers = inquirer.prompt(questions) | ||
|
||
pprint(answers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters