Skip to content
Permalink
Browse files
Added identification to functions I have worked on
  • Loading branch information
hortonr6 committed Nov 20, 2017
1 parent 7fb2a43 commit 0cac8954f2cfd424fe5f54d7ed9745d85561835f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
@@ -7,7 +7,7 @@ import webbrowser
thisSocket = socket.socket()
thisSocket.connect(("127.0.0.1",5001))

def chatbotExit():
def chatbotExit(): #Richard
''' Sends a message to the server to notify it that the chatbot is
quitting and then closes the interface and allows other functions
to end properly'''
@@ -16,11 +16,11 @@ def chatbotExit():
window.quit()
return None

def openLink(url):
def openLink(url): #Richard
''' Opens the link sent by the server'''
webbrowser.open(url, new=2)

def receiveMessage(i):
def receiveMessage(i): #Richard
''' Receives multiple messages from server if needed, until server
sends EndOfMessage and displays the recieved messages on the user
interface'''
@@ -57,7 +57,7 @@ def receiveMessage(i):
chatHistory.configure(state="disabled") #prevents user from editing the chat history
message = thisSocket.recv(1024).decode()

def sendMessage(event=None):
def sendMessage(event=None): #Richard
'''Waits for the user to enter a messasge in the text entry box in the
interface and then takes this input from the user and feeds it to the
chatbot/server, allowing it to respond to the input appropriately.'''
2 GUI.py
@@ -15,7 +15,7 @@ userInput.pack()
lbl = tk.Label(window, text="\nChatHistory", bg="cornflower blue")
lbl.pack()

def cb(event):
def cb(event): #Richard
userText = userInput.get()
userName = gf.getName(userText)
userName = userName.title()
@@ -1,7 +1,7 @@
import tkinter as tk
import determineUserInput as detUsrIn

def chat(event):
def chat(event): #Richard
'''This function takes the input from the user and feeds it to the chatbot, allowing
the chatbot to respond to the input appropriately. Essentially this function
bridges the GUI and chatbot'''
@@ -12,7 +12,7 @@ randomStuff = ["Cherophobia is the fear of fun","A flock of crows is called a mu

#=========================================================================================================

def getName(sentence):
def getName(sentence): #Jasper, Richard
"""get the name of the user from the inputed sentence"""
userWords = sentence.split()

0 comments on commit 0cac895

Please sign in to comment.