-
Notifications
You must be signed in to change notification settings - Fork 0
/
system_enhancer.py
68 lines (49 loc) · 1.79 KB
/
system_enhancer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
import os
from tkinter import *
from tkinter.ttk import *
import system_check
import delete_directory
import sort_files
screen = Tk()
screen.title("System Enhancer")
screen.geometry("1000x500")
keys = []
file_location = os.path.join(os.path.dirname(__file__), "Keys.txt")
file_key_var = StringVar()
folder_name_var = StringVar()
def import_keys(file_location):
with open(file_location) as file:
for line in file:
keys.append(line.strip())
def manage_k():
manage_screen = Toplevel(screen)
manage_screen.title("Manage Keys")
manage_screen.geometry("500x500")
print(keys)
print("managing")
def add_k():
add_screen = Toplevel(screen)
add_screen.title("Add Keys")
add_screen.geometry("500x500")
Label(add_screen, text="File Key").grid(row=0, column=2)
Label(add_screen, text="Folder Name").grid(row=1, column=2)
file_key = Entry(add_screen, textvariable = file_key_var, width=50)
folder_name = Entry(add_screen, textvariable = folder_name_var, width=50)
file_key.grid(row=0, column=3)
folder_name.grid(row=1, column=3)
add_key = Button(add_screen, text="Submit", command = submit_key)
add_key.grid(row=2, column=2)
import_keys(file_location)
print("Adding")
def submit_key():
f_k = file_key_var.get()
f_n = folder_name_var.get()
with open(file_location, "a") as file:
file.write(str(f_k) + "_" + " :: " + str(f_n) + "\n")
file_key_var.set("")
folder_name_var.set("")
import_keys(file_location)
manage_keys = Button(screen, text="Manage Keys", width=25, command=manage_k).grid(row=0, column=5)
add_keys = Button(screen, text="Add Keys", width=25, command=add_k).grid(row=1, column = 5)
screen.mainloop()