mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-25 22:52:24 +03:00
agreement minor fixing
This commit is contained in:
parent
e78328c880
commit
a7979e6006
2 changed files with 4 additions and 2 deletions
|
@ -53,6 +53,7 @@ class Agreement:
|
||||||
try:
|
try:
|
||||||
agreement_path = System.Ahenk.received_dir_path() + Util.generate_uuid()
|
agreement_path = System.Ahenk.received_dir_path() + Util.generate_uuid()
|
||||||
Util.write_file(agreement_path, content)
|
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)
|
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)
|
result_code, p_out, p_err = Util.execute(command)
|
||||||
pout = str(p_out).replace('\n', '')
|
pout = str(p_out).replace('\n', '')
|
||||||
|
|
|
@ -3,7 +3,7 @@ import easygui
|
||||||
|
|
||||||
|
|
||||||
def ask(content, title):
|
def ask(content, title):
|
||||||
choice = easygui.ynbox(content, title, ('Evet', 'Hayır'))
|
choice = easygui.textbox(msg=title, text=content, codebox=0)
|
||||||
if choice:
|
if choice:
|
||||||
print('Y')
|
print('Y')
|
||||||
else:
|
else:
|
||||||
|
@ -11,10 +11,11 @@ def ask(content, title):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
if len(sys.argv) == 3:
|
if len(sys.argv) == 3:
|
||||||
try:
|
try:
|
||||||
ask(sys.argv[1], sys.argv[2])
|
ask(sys.argv[1], sys.argv[2])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
else:
|
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))
|
||||||
|
|
Loading…
Reference in a new issue