From 9a0897c7e31e2751a4e3a2839689d0faa3e74c0b Mon Sep 17 00:00:00 2001 From: eladeyal-intel Date: Wed, 8 May 2019 18:19:21 +0300 Subject: [PATCH 1/4] example showing gooey works with formlayout --- examples/formlayout.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 examples/formlayout.py diff --git a/examples/formlayout.py b/examples/formlayout.py new file mode 100644 index 0000000..f6e861d --- /dev/null +++ b/examples/formlayout.py @@ -0,0 +1,26 @@ +''' +Combining Gooey and formlayout +''' + +import sys +from gooey import Gooey, GooeyParser +from formlayout import fedit + + + +@Gooey(auto_start=True) +def main(): + _ = GooeyParser().parse_args(sys.argv[1:]) + + print('Demo starting') + R=fedit(title='Interactive data input example', + data=[ ('What is your name', ''), + ('Are you married?',[2, 'Yes', 'No', 'It\'s complicated']) ], + comment='Please fill the following information with care.') + + if R: + print('Welcome {}'. format(R[0])) + print('Your marital status is: '. format(R[1])) + +if __name__ == '__main__': + main() From 1b76991ff56d0cba11bf821f3670eaa24fac05e4 Mon Sep 17 00:00:00 2001 From: eladeyal-intel Date: Wed, 8 May 2019 18:27:13 +0300 Subject: [PATCH 2/4] Update formlayout.py --- examples/formlayout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/formlayout.py b/examples/formlayout.py index f6e861d..7f4b3bf 100644 --- a/examples/formlayout.py +++ b/examples/formlayout.py @@ -20,7 +20,9 @@ def main(): if R: print('Welcome {}'. format(R[0])) - print('Your marital status is: '. format(R[1])) + print('Marital status: {}'. format([ 'Married', + 'Free', + 'Not specified' ][R[1]])) if __name__ == '__main__': main() From b78f3a271c77abe9186f6084ca2fe6239489ec47 Mon Sep 17 00:00:00 2001 From: eladeyal-intel Date: Fri, 10 May 2019 12:50:03 +0300 Subject: [PATCH 3/4] simplify --- examples/formlayout.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/formlayout.py b/examples/formlayout.py index 7f4b3bf..7d598c4 100644 --- a/examples/formlayout.py +++ b/examples/formlayout.py @@ -6,8 +6,6 @@ from gooey import Gooey, GooeyParser from formlayout import fedit - - @Gooey(auto_start=True) def main(): _ = GooeyParser().parse_args(sys.argv[1:]) @@ -19,10 +17,10 @@ def main(): comment='Please fill the following information with care.') if R: - print('Welcome {}'. format(R[0])) + name,mstat = R + print('Welcome {}'. format(name)) print('Marital status: {}'. format([ 'Married', 'Free', - 'Not specified' ][R[1]])) - + 'Not specified' ][mstat])) if __name__ == '__main__': main() From 9d1b1fd422376d7f4daf2cd0d75329d7ecd4a0f9 Mon Sep 17 00:00:00 2001 From: eladeyal-intel Date: Fri, 10 May 2019 12:50:55 +0300 Subject: [PATCH 4/4] Rename formlayout.py to example_formlayout.py --- examples/{formlayout.py => example_formlayout.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{formlayout.py => example_formlayout.py} (100%) diff --git a/examples/formlayout.py b/examples/example_formlayout.py similarity index 100% rename from examples/formlayout.py rename to examples/example_formlayout.py