diff --git a/__pycache__/debian.cpython-39.pyc b/__pycache__/debian.cpython-39.pyc new file mode 100644 index 0000000..a56b019 Binary files /dev/null and b/__pycache__/debian.cpython-39.pyc differ diff --git a/__pycache__/fedora.cpython-39.pyc b/__pycache__/fedora.cpython-39.pyc new file mode 100644 index 0000000..13f600c Binary files /dev/null and b/__pycache__/fedora.cpython-39.pyc differ diff --git a/debian.py b/debian.py new file mode 100644 index 0000000..5c57190 --- /dev/null +++ b/debian.py @@ -0,0 +1,15 @@ +import os + + +def installinstok(text): + os.system("lxterminal -e 'apt update && apt install "+ text +"'") + +def searchtok(text): + os.system("lxterminal -e 'apt update && apt search " + str(text) + " && read'") + +def removetok(text): + os.system("lxterminal -e 'apt remove " + str(text) + "'") + +def update(): + os.system("lxterminal -e 'apt update && apt upgrade'") + diff --git a/fedora.py b/fedora.py new file mode 100644 index 0000000..455fdad --- /dev/null +++ b/fedora.py @@ -0,0 +1,15 @@ +import os + + +def installinstok(text): + os.system("lxterminal -e 'dnf install "+ text +"'") + +def searchtok(text): + os.system("lxterminal -e 'dnf search " + str(text) + " && read'") + +def removetok(text): + os.system("lxterminal -e 'dnf remove " + str(text) + "'") + +def update(): + os.system("lxterminal -e 'dnf update'") + diff --git a/init.py b/init.py index 1b688b4..1b6fd7d 100644 --- a/init.py +++ b/init.py @@ -4,6 +4,11 @@ from tkinter import messagebox from tkinter import ttk import os +#distro +import fedora as distro +import debian + + BUTTONHEIGHT='3' BUTTONWIDTH='44' @@ -21,13 +26,10 @@ def install(): entry = ttk.Entry(instscreen, width=20) entry.place(x=15, y=10) - instok = tk.Button(instscreen, command=lambda: installinstok(entry.get()), text='ok', height=1, width=3) + instok = tk.Button(instscreen, command=lambda: distro.installinstok(entry.get()), text='ok', height=1, width=3) instok.place(x=70, y=40) instscreen.mainloop() - -def installinstok(text): - os.system("lxterminal -e 'dnf install "+ text +"'") def search(): @@ -39,12 +41,10 @@ def search(): entry = ttk.Entry(searchscreen, width=20) entry.place(x=15, y=10) - instok = tk.Button(searchscreen, command=lambda: searchtok(entry.get()), text='ok', height=1, width=3) + instok = tk.Button(searchscreen, command=lambda: distro.searchtok(entry.get()), text='ok', height=1, width=3) instok.place(x=70, y=40) searchscreen.mainloop() -def searchtok(text): - os.system("lxterminal -e 'dnf search " + str(text) + " && read'") def remove(): removescreen = tk.Tk() @@ -55,22 +55,16 @@ def remove(): entry = ttk.Entry(removescreen, width=20) entry.place(x=15, y=10) - instok = tk.Button(removescreen, command=lambda: removetok(entry.get()), text='ok', height=1, width=3) + instok = tk.Button(removescreen, command=lambda: distro.removetok(entry.get()), text='ok', height=1, width=3) instok.place(x=70, y=40) removescreen.mainloop() - -def removetok(text): - os.system("lxterminal -e 'dnf remove " + str(text) + "'") -def update(): - os.system("lxterminal -e 'sudo dnf update'") - def main(): buttoninstall = tk.Button(screen, command=install, text='install', height=BUTTONHEIGHT, width=BUTTONWIDTH) buttonsearch = tk.Button(screen, command=search, text='search', height=BUTTONHEIGHT, width=BUTTONWIDTH) buttonremove = tk.Button(screen, command=remove, text='remove', height=BUTTONHEIGHT, width=BUTTONWIDTH) - buttonupdate = tk.Button(screen, command=update, text='update', height=BUTTONHEIGHT, width=BUTTONWIDTH) + buttonupdate = tk.Button(screen, command=distro.update, text='update', height=BUTTONHEIGHT, width=BUTTONWIDTH) buttoninstall.place(x='10', y='30') buttonsearch.place(x='10', y='95')