Ahenk/usr/share/ahenk/base/agreement/ahenkmessage.py
2020-04-06 18:10:41 +03:00

47 lines
No EOL
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import sys
from easygui import multpasswordbox, msgbox
def ask(message, title, host):
field_names=[]
if host =='':
field_names.append("Etki Alanı Sunucusu:")
field_names.append("Yetkili Kullanıcı")
field_names.append("Parola")
field_values = multpasswordbox(
msg=message,
title=title, fields=(field_names))
if field_values is None:
return print('N');
is_fieldvalue_empty = False;
for value in field_values:
if value == '':
is_fieldvalue_empty = True;
if is_fieldvalue_empty:
msgbox("Lütfen zorunlu alanları giriniz.", ok_button="Tamam")
return print('Z');
if host =='':
print(field_values[0],field_values[1],field_values[2])
else:
print(field_values[0], field_values[1])
if __name__ == '__main__':
if len(sys.argv) > 1:
try:
message=sys.argv[1]
title=sys.argv[2]
host=sys.argv[3]
ask(message,title, host)
except Exception as e:
print(str(e))
else:
print('Argument fault. Check your parameters or content of parameters. Parameters: ' + str(sys.argv))