From 6a1e08cf1885b16736182835ec10b91997c2d125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Tue, 23 Aug 2016 16:50:46 +0300 Subject: [PATCH] confirmation interface --- opt/ahenk/base/agreement/confirm.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 opt/ahenk/base/agreement/confirm.py diff --git a/opt/ahenk/base/agreement/confirm.py b/opt/ahenk/base/agreement/confirm.py new file mode 100755 index 0000000..b18bc74 --- /dev/null +++ b/opt/ahenk/base/agreement/confirm.py @@ -0,0 +1,21 @@ +import sys +import easygui + + +def confirm(message, title): + choice = easygui.ccbox(msg=message, title=title, choices=("Evet", "Hayır")) + if choice: + print('Y') + else: + print('N') + + +if __name__ == '__main__': + + if len(sys.argv) == 3: + try: + confirm(sys.argv[1], sys.argv[2]) + except Exception as e: + print(str(e)) + else: + print('Argument fault. Check your parameters or content of parameters. Parameters: ' + str(sys.argv))