示例#1
0
def clientOK():
	global ClientSelect
	if selectedOption != None and selectedOption != "NEW" and selectedOption != "None":
		if ClientIPEntry.get()!="" and ClientNameInput!="":
			try:
				if clientDict[selectedClientOption]!=-1:
					theGroup[groupDict[selectedOption]].setClientIP(clientDict[selectedClientOption],ClientIPEntry.get())
					theGroup[groupDict[selectedOption]].changeClientName(clientDict[selectedClientOption],ClientNameInput.get())
				else:
					theGroup[groupDict[selectedOption]].addClient(client(name=ClientNameInput.get(),group=groupDict[selectedOption],Address=ClientIPEntry.get(),log=log(name="none",isOn=FALSE)))
			except KeyError:
				pass
		else:
			messagebox.showerror(title="empty Input",message="Inputs are empty")
		clientDict.clear()
		ClientNameInput.delete(0,END)
		ClientIPEntry.delete(0,END)
		ClientSelect.grid_remove()
		ClientSelect=None
		clientDict.clear()
		createClientList()
		createClientList()
		ClientSelect=ttk.OptionMenu(mainWindow,StringVar(mainWindow),None,*clientDict,command=clientOptionChanged)
		packWindow()
	else:
		messagebox.showerror(title= "no Group selected", message= "No Group Selected")
		ClientNameInput.delete(0,END)
		ClientIPEntry.delete(0,END)		
示例#2
0
def clientOK():
    global ClientSelect
    if selectedOption != None and selectedOption != "NEW" and selectedOption != "None":
        if ClientIPEntry.get() != "" and ClientNameInput != "":
            try:
                if clientDict[selectedClientOption] != -1:
                    theGroup[groupDict[selectedOption]].setClientIP(
                        clientDict[selectedClientOption], ClientIPEntry.get())
                    theGroup[groupDict[selectedOption]].changeClientName(
                        clientDict[selectedClientOption],
                        ClientNameInput.get())
                else:
                    theGroup[groupDict[selectedOption]].addClient(
                        client(name=ClientNameInput.get(),
                               group=groupDict[selectedOption],
                               Address=ClientIPEntry.get(),
                               log=log(name="none", isOn=False)))
            except KeyError:
                pass
        else:
            messagebox.showerror(title="empty Input",
                                 message="Inputs are empty")
        clientDict.clear()
        ClientNameInput.delete(0, END)
        ClientIPEntry.delete(0, END)
        ClientSelect.grid_remove()
        ClientSelect = None
        clientDict.clear()
        createClientList()
        createClientList()
        ClientSelect = ttk.OptionMenu(mainWindow,
                                      StringVar(mainWindow),
                                      None,
                                      *clientDict,
                                      command=clientOptionChanged)
        packWindow()
    else:
        messagebox.showerror(title="no Group selected",
                             message="No Group Selected")
        ClientNameInput.delete(0, END)
        ClientIPEntry.delete(0, END)
示例#3
0
 def addGroupClient(self, roupID, clientName, clientAddress):
     self.__theClients.append(client(clientName, len(
         self.__theGrous) - 1, clientAddress, self.mainLog))
     self.__theGrous[
         len(self.__theGrous) - 1].addClient(self.__theClients[len(self.__theClients) - 1])
示例#4
0
def addGroupClient(groupID, clientName, clientAddress):
    return theGroup[groupID].addClient(
        client(name=clientName,
               group=groupID,
               Address=clientAddress,
               log=log(name="none", isOn=FALSE)))
示例#5
0
def addGroupClient(groupID, clientName, clientAddress):
	return theGroup[groupID].addClient(client(name=clientName,group=groupID,Address=clientAddress,log=log(name="none",isOn=FALSE)))