From a7979e600688940600fd4dc55ccac20c9d9b5758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Thu, 30 Jun 2016 15:42:01 +0300 Subject: [PATCH] agreement minor fixing --- opt/ahenk/base/agreement/agreement.py | 1 + opt/ahenk/base/agreement/ask.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/opt/ahenk/base/agreement/agreement.py b/opt/ahenk/base/agreement/agreement.py index f804554..d748c0f 100644 --- a/opt/ahenk/base/agreement/agreement.py +++ b/opt/ahenk/base/agreement/agreement.py @@ -53,6 +53,7 @@ class Agreement: try: agreement_path = System.Ahenk.received_dir_path() + Util.generate_uuid() Util.write_file(agreement_path, content) + Util.set_permission(agreement_path, 777) command = 'export DISPLAY={0};su - {1} -c \'python3 {2} \"$(cat {3})\" \"{4}\"\''.format(display, username, self.ask_path, agreement_path, title) result_code, p_out, p_err = Util.execute(command) pout = str(p_out).replace('\n', '') diff --git a/opt/ahenk/base/agreement/ask.py b/opt/ahenk/base/agreement/ask.py index ecb49ce..bf4b4a8 100755 --- a/opt/ahenk/base/agreement/ask.py +++ b/opt/ahenk/base/agreement/ask.py @@ -3,7 +3,7 @@ import easygui def ask(content, title): - choice = easygui.ynbox(content, title, ('Evet', 'Hayır')) + choice = easygui.textbox(msg=title, text=content, codebox=0) if choice: print('Y') else: @@ -11,10 +11,11 @@ def ask(content, title): if __name__ == '__main__': + if len(sys.argv) == 3: try: ask(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)) + print('Argument fault. Check your parameters or content of parameters. Parameters: ' + str(sys.argv))