#!/usr/bin/python
import easygui as gui
import os
import sys
#start here
title = " advanced apt-get"
if os.geteuid() != 0:
    print 'error dont have root acces.'
    sys.exit(1)
task = gui.buttonbox(title=title,
                msg="choice a task", choices=("install", "remove", "upgrade"))
if task == "upgrade":
       command = "sudo apt-get upgrade"
elif task == "None":
    exit()
elif (task == "install") or (task == "remove"):
    pack = gui.enterbox(title=title,
                        msg="write a packet to work")
    command = "sudo apt-get " + task + " " + pack + " -y"
else:
    exit()
#execute
os.system(command)
fin = gui.msgbox(title=title ,
            msg="task completed", ok_button="finish")
if fin == "finish":
    exit()
