def __init__(self, queue): Tk.__init__(self) self.title("Spigot Build Tools - Made by AGMDevelopment") self.iconbitmap('./icon.ico') self.resizable(False, False) self.queue = queue versions = Frame(self) versions.grid(column=0, row=0, sticky="W") craftbukkit = Frame(versions) craftbukkit.grid(column=1, row=0, sticky="NW") label = Label(craftbukkit, text="For 1.14+ Only") label.grid(column=0, row=0, sticky="W") self.craft = ChecklistBox(craftbukkit, ["Craft Bukkit"], selected=True) self.craft.grid(column=0, row=1, sticky="W") from main import VERSIONS self.list = ChecklistBox(versions, VERSIONS) self.list.grid(column=0, row=0, sticky="W") frame = Frame(self) frame.grid(column=0, row=1) btn1 = Button(frame, text="Queue versions", command=self.queue_all) btn1.grid(column=0, row=0, padx=10, pady=10) btn2 = Button(frame, text="More Workers", command=lambda: Worker.add(self.log_frame, self.queue)) btn2.grid(column=1, row=0, padx=10, pady=10) btn3 = Button(frame, text="Less Workers", command=lambda: Worker.close_last()) btn3.grid(column=2, row=0, padx=10, pady=10) self.log_frame = LabelFrame(self, text='Workers log') self.log_frame.grid(column=0, row=2) ntw = NetworkMeter(self) ntw.grid(column=0, row=3, sticky='w')
def start(self): from main import MAX_THREAD for _ in range(MAX_THREAD): Worker.add(self.log_frame, self.queue) self.mainloop()