import main def sendData(addr, data): main.connections[addr].send(data) def sendSuccess(addr, data): sendData(addr, "[y] " + data) def sendFailure(addr, data): sendData(addr, "[n] " + data) def sendInfo(addr, data): sendData(addr, "[i] " + data) def sendAll(data): for i in main.connections: main.connections[i].send(data) return def incorrectUsage(addr, mode): if mode == None: sendFailure(addr, "Incorrect usage") return if mode in main.help.keys(): sendFailure(addr, "Usage: " + main.help[mode]) return