Ahenk/usr/share/ahenk/base/agreement/confirm.py

29 lines
689 B
Python
Raw Normal View History

2020-04-06 18:10:41 +03:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
import os
2020-04-06 18:10:41 +03:00
import sys
import easygui
def confirm(message, title):
choice = easygui.buttonbox(msg=message, title=title, choices=["Tamam"])
if choice:
print('Y')
else:
print('N')
if __name__ == '__main__':
if len(sys.argv) == 4:
2020-04-06 18:10:41 +03:00
try:
display=sys.argv[3]
os.environ["DISPLAY"] = display
2020-04-06 18:10:41 +03:00
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))