| 1 |
#! /usr/bin/python3 |
| 2 |
|
| 3 |
import tkinter |
| 4 |
import tkinter.messagebox |
| 5 |
import subprocess |
| 6 |
|
| 7 |
import gettext |
| 8 |
gettext.bindtextdomain('expeyes') |
| 9 |
gettext.textdomain('expeyes') |
| 10 |
_ = gettext.gettext |
| 11 |
|
| 12 |
def create_microhope_env(): |
| 13 |
print ("creating microhope environment") |
| 14 |
subprocess.call("mkdir -p ~/microhope && cp -Rd /usr/share/microhope/microhope/* ~/microhope", shell=True) |
| 15 |
|
| 16 |
top = tkinter.Tk() |
| 17 |
top.withdraw() |
| 18 |
|
| 19 |
if tkinter.messagebox.askyesno(_("Create microHope environment"), |
| 20 |
_("Do you want to create your own microHope environment?\n\nIf you reply \"Yes\", a subdirectory named microHope will be created in your home directory, and a set of files will be copied into it.\n\nIf any previous installation existed, its contents will be overwriten.") |
| 21 |
): |
| 22 |
create_microhope_env() |
| 23 |
else: |
| 24 |
top.quit() |
| 25 |
|
| 26 |
#top.mainloop() |