2020-04-06 18:13:10 +03:00
|
|
|
|
import os
|
2020-04-06 18:10:41 +03:00
|
|
|
|
import sys
|
|
|
|
|
from easygui import multpasswordbox, msgbox
|
|
|
|
|
|
|
|
|
|
def ask(message, title):
|
|
|
|
|
|
|
|
|
|
field_names = []
|
|
|
|
|
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:
|
2020-04-06 18:13:10 +03:00
|
|
|
|
return print('N')
|
2020-04-06 18:10:41 +03:00
|
|
|
|
|
2020-04-06 18:13:10 +03:00
|
|
|
|
is_fieldvalue_empty = False
|
2020-04-06 18:10:41 +03:00
|
|
|
|
|
|
|
|
|
for value in field_values:
|
|
|
|
|
if value == '':
|
2020-04-06 18:13:10 +03:00
|
|
|
|
is_fieldvalue_empty = True
|
2020-04-06 18:10:41 +03:00
|
|
|
|
|
|
|
|
|
if is_fieldvalue_empty:
|
|
|
|
|
msgbox("Lütfen zorunlu alanları giriniz.", ok_button="Tamam")
|
2020-04-06 18:13:10 +03:00
|
|
|
|
return print('Z')
|
2020-04-06 18:10:41 +03:00
|
|
|
|
|
|
|
|
|
print(field_values[0], field_values[1])
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
|
try:
|
|
|
|
|
message=sys.argv[1]
|
|
|
|
|
title=sys.argv[2]
|
2020-04-06 18:13:10 +03:00
|
|
|
|
display = sys.argv[3]
|
|
|
|
|
os.environ["DISPLAY"] = display
|
2020-04-06 18:10:41 +03:00
|
|
|
|
ask(message,title)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(str(e))
|
|
|
|
|
else:
|
|
|
|
|
print('Argument fault. Check your parameters or content of parameters. Parameters: ' + str(sys.argv))
|