From 57043d71463fd49833c106bd792475005d20d47b Mon Sep 17 00:00:00 2001 From: Arlington1985 Date: Thu, 30 Jul 2020 23:17:42 +0200 Subject: [PATCH 1/6] Fix double prompt --- examples/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/list.py b/examples/list.py index 696c4c1..08e63e4 100644 --- a/examples/list.py +++ b/examples/list.py @@ -51,5 +51,5 @@ def get_delivery_options(answers): }, ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) pprint(answers) From 42281cab66c46b2d93c5fc2a9e568574fb77881b Mon Sep 17 00:00:00 2001 From: Arlington1985 Date: Thu, 30 Jul 2020 23:35:55 +0200 Subject: [PATCH 2/6] Fix Typo --- examples/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/list.py b/examples/list.py index 08e63e4..5e648ca 100644 --- a/examples/list.py +++ b/examples/list.py @@ -52,4 +52,4 @@ def get_delivery_options(answers): ] answers = prompt(questions, style=custom_style_2) -pprint(answers) +print(answers) From 5a324576630c4114114612bb842fce3bb549b614 Mon Sep 17 00:00:00 2001 From: Rovshan Musayev Date: Fri, 31 Jul 2020 00:02:21 +0200 Subject: [PATCH 3/6] Fix double prompt issue --- examples/checkbox.py | 2 +- examples/confirm.py | 2 +- examples/editor.py | 2 +- examples/expand.py | 2 +- examples/hierarchical.py | 4 ++-- examples/pizza.py | 2 +- examples/rawlist.py | 2 +- examples/when.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/checkbox.py b/examples/checkbox.py index 8e76128..ff462ed 100644 --- a/examples/checkbox.py +++ b/examples/checkbox.py @@ -65,5 +65,5 @@ } ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) pprint(answers) diff --git a/examples/confirm.py b/examples/confirm.py index 5fb08c8..c676fdf 100644 --- a/examples/confirm.py +++ b/examples/confirm.py @@ -25,6 +25,6 @@ }, ] -answers = prompt.prompt(questions, style=custom_style_1) +answers = prompt(questions, style=custom_style_1) pprint(answers) diff --git a/examples/editor.py b/examples/editor.py index 3512a08..9b36bcd 100644 --- a/examples/editor.py +++ b/examples/editor.py @@ -22,5 +22,5 @@ } ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) pprint(answers) diff --git a/examples/expand.py b/examples/expand.py index 4ae7158..a646055 100644 --- a/examples/expand.py +++ b/examples/expand.py @@ -41,5 +41,5 @@ } ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) print_json(answers) diff --git a/examples/hierarchical.py b/examples/hierarchical.py index bc99de0..e1f92f8 100644 --- a/examples/hierarchical.py +++ b/examples/hierarchical.py @@ -14,7 +14,7 @@ def ask_direction(): 'message': 'Which direction would you like to go?', 'choices': ['Forward', 'Right', 'Left', 'Back'] } - answers = prompt.prompt(directions_prompt) + answers = prompt(directions_prompt) return answers['direction'] # TODO better to use while loop than recursion! @@ -67,7 +67,7 @@ def encounter2a(): def encounter2b(): - prompt.prompt({ + prompt({ 'type': 'list', 'name': 'weapon', 'message': 'Pick one', diff --git a/examples/pizza.py b/examples/pizza.py index 1d6a4ec..f1a487e 100644 --- a/examples/pizza.py +++ b/examples/pizza.py @@ -106,6 +106,6 @@ def validate(self, document): } ] -answers = prompt.prompt(questions, style=custom_style_3) +answers = prompt(questions, style=custom_style_3) print('Order receipt:') pprint(answers) diff --git a/examples/rawlist.py b/examples/rawlist.py index 5509251..bba91a3 100644 --- a/examples/rawlist.py +++ b/examples/rawlist.py @@ -32,5 +32,5 @@ } ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) print_json(answers) diff --git a/examples/when.py b/examples/when.py index 4c850a3..a06c18d 100644 --- a/examples/when.py +++ b/examples/when.py @@ -41,6 +41,6 @@ def dislikes_bacon(answers): } ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) print_json(answers) From 67700b78ef3c721ba405f2e45058250faccae01e Mon Sep 17 00:00:00 2001 From: Rovshan Musayev Date: Fri, 31 Jul 2020 00:12:27 +0200 Subject: [PATCH 4/6] return pprint --- examples/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/list.py b/examples/list.py index 5e648ca..08e63e4 100644 --- a/examples/list.py +++ b/examples/list.py @@ -52,4 +52,4 @@ def get_delivery_options(answers): ] answers = prompt(questions, style=custom_style_2) -print(answers) +pprint(answers) From 4dccb2c3f006dcd16d120695c23454d732aa1cab Mon Sep 17 00:00:00 2001 From: Rovshan Musayev Date: Fri, 31 Jul 2020 00:21:40 +0200 Subject: [PATCH 5/6] Fix double prompt --- examples/password.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/password.py b/examples/password.py index b7319e6..7042ddc 100644 --- a/examples/password.py +++ b/examples/password.py @@ -17,5 +17,5 @@ } ] -answers = prompt.prompt(questions, style=custom_style_2) +answers = prompt(questions, style=custom_style_2) print_json(answers) From 42d564bf53a6edde673625d9ca4a70b5fdb1cc62 Mon Sep 17 00:00:00 2001 From: Rovshan Musayev Date: Fri, 31 Jul 2020 01:08:24 +0200 Subject: [PATCH 6/6] Fix run instruction --- examples/expand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/expand.py b/examples/expand.py index a646055..5d69780 100644 --- a/examples/expand.py +++ b/examples/expand.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ * example for expand question type -* run example by typing `python example/checkbox.py` in your console +* run example by typing `python example/expand.py` in your console """ from PyInquirer import style_from_dict, Token, prompt, print_json, Separator