Ejemplo n.º 1
0
def start_chat():
    show_menu = True
    while show_menu:
        print("\nYou can select from the operations")
        print(
            "1. Add Friend\n 2. Add Status\n 3. Send Secret Message\n 4. Read Secret Message\n 5. Close application"
        )
        menu_choice = int(input("What do you want to do: "))

        if menu_choice == 1:
            print("\nYou have chosen to add a friend")
            spy_friend.add_friend()
        elif menu_choice == 2:
            print("\nYou have chosen to add a status")
            spy.current_status_message = spy_status.add_status(
                spy.current_status_message)
        elif menu_choice == 3:
            print("\nYou have chosen to send message")
            spy_friend.send_message()
        elif menu_choice == 4:
            print("\nYou have chosen to read message")
            spy_friend.read_message()
            #print(current_chat)
        elif menu_choice == 5:
            print("\nYou have chosen to close the application")
            show_menu = False
        else:
            print("\nIncorrect choice")
Ejemplo n.º 2
0
def start_chat()   :
        
        show_menu=True

        while show_menu:
            print "1.Add Status  \n 2.Add Friend\n 3. Send Secret Message\n 4. Read Secret Message\n 5.Close Application.\n"
            menu_choice=raw_input("What do You want to do: ")

            if menu_choice=='1':
                # update the status
                print "You have chosen to update a status"
                spy.current_status_message = spy_status.add_status(spy.current_status_message)
            elif menu_choice =='2':
                # Add Friend
                print "You have chosen to add a Friend"
                spy_friend.add_friend()
            elif menu_choice == '3':
                # Send a secret message
                print "\n You Have Chosen to send a secret message to a friend"
                spy_friend.send_message()
            elif menu_choice == '4':
                # Read a secret message
                print "\n You Have Chosen to read a secret message of a friend"
                spy_friend.read_message()
            elif menu_choice=='5':
                show_menu=False
            else:
                print "\nIncorrect Choice"
Ejemplo n.º 3
0
def start_chat(spy_name, spy_salutation, spy_age, spy_rating):
    current_status_message = None
    show_menu = True
    while show_menu == True:
        Menu_choice = raw_input(
            "1.Add a status update\n2.Add a friend\n3.Send secret message\n4.Read secret message\n5.Exit Application"
        )
        if Menu_choice == '1':
            #update the status
            print("you have choosn to add a status")
            current_status_message = spy_status.add_status(
                current_status_message)
        elif Menu_choice == '2':
            print("you have to choosen to add a friend\n")
            spy_friend.add_friend()
        elif Menu_choice == '3':
            print("you have choosen to Send message\n")
            spy_friend.send_message()
        elif Menu_choice == '4':
            print("you have choosen to Read message\n")
            spy_friend.read_message()
        elif Menu_choice == '5':
            print("you have choosen to close the Application\n")
            show_menu = False
        else:
            print("incorrect choice\n")
def start_chat():
    show_menu = True
    while show_menu == True:
        menu_choice = raw_input(
            "1. Add a status update\n2. Add Friend\n3. Send message to a friend\n4. Read secret messages of a friend\n5. Read chat history of a friend\n6. Exit Application"
        )
        if menu_choice == '1':
            #update the status
            print "\nYou have chosen to add a status"
            spy.current_status_message = spy_status.add_status(
                spy.current_status_message)
        elif menu_choice == '2':
            print "\nYou have chosen to add a friend"
            spy_friend.add_friend()
        elif menu_choice == '3':
            print "\nYou have chosen to send a secret message to a friend"
            spy_friend.send_message()
        elif menu_choice == '4':
            print "\nYou have chosen to read a secret message of a friend"
            spy_friend.read_message()
        elif menu_choice == '5':
            print "\nYou have chosen to read chat history of a friend"
            spy_friend.read_chat_history()
        elif menu_choice == '6':
            print "\nYou have chosen to close the Application"
            show_menu = False
        else:
            print "\nInCorrect Choice"
Ejemplo n.º 5
0
def start_chat(spy_name, spy_age, spy_rating):
    current_status_message = None
    show_menu = True

    while show_menu:

        menu_choice = int(
            input(
                "1. Add a status \n 2. Add a Friend \n 3. Send a message \n 4. close application"
            ))

        if menu_choice == 1:
            print("U have chosen to add a status")
            current_status_message = spy_status.add_status(
                current_status_message)
            #print("your current message is",current_status_message)
        elif menu_choice == 2:
            print("U have chosen add a Friend")
            current_new_user = spy_friend.add_friend()
            print(current_new_user)
        elif menu_choice == 3:
            print("U have chosen to send a message")

            msg = spy_message.chat1(spy_friend.friends,
                                    spy_friend.new_spy_profile)
            print(msg)

        elif menu_choice == 4:
            show_menu = False
Ejemplo n.º 6
0
def spy_chat():
    #   Displaying spy's information:
    print colored(
        "\nSpy_name:%s \nAge:%d \nRating:%.2f \nOnline_status:%s " %
        (info.name, info.age, info.rating, info.online_status), 'green')

    while True:
        menu_choice = int(
            raw_input(
                "\nwhat do you want to do? \n1.Add a status Update "
                "\n2.Add friend \n3.View friend's details \n4.Send Secret message."
                "\n5.Read Secret message.\n6.Read older chats from any of my spy friends"
                "\n7.Close the Application\n"))
        if menu_choice == 1:
            if len(info.status_messages) == 0:
                current_status_message = "None"
            else:
                current_status_message = info.status_messages[-1]
            current_status_message = add_status(current_status_message)
            print "\n--Your current_status_message is--\n" + colored(
                "%s" % current_status_message, 'green')

        elif menu_choice == 2:
            add_friend(info.rating)
        elif menu_choice == 3:
            print "Select a friend whose detail you want to view"
            select_friend()
        elif menu_choice == 4:
            send_message()
        elif menu_choice == 5:
            read_message()
        elif menu_choice == 6:
            read_old_mess()
        elif menu_choice == 7:
            break
        else:
            print colored("Enter correct Choice", 'red')
Ejemplo n.º 7
0
def start_chat():
	show_menu = True
	while show_menu:
		print("\nYou can choose from the below Operations.")
		print("1. Add Friend\n2. Add Status\n3. Send a Message\n4. Read a Message\n5. Close application")
		menu_choice = int(input("What would your choice be: "))

		if menu_choice == 1:
			print("\nYou have chosen to add a Friend.")
			spy_friend.add_friend()
		elif menu_choice == 2:
			print("\nYou have chosen to update your Status.")
			spy.current_status_message = spy_status.add_status(spy.current_status_message)
		elif menu_choice == 3:
			print("\nYou have chosen to send a Message to a Friend.")
			spy_friend.send_message()
		elif menu_choice == 4:
			print("\nYou have chosen to read a Message from a Friend.")
			spy_friend.read_message()
		elif menu_choice == 5:
			print("\nYou have chosen to terminate the application.")
			show_menu = False
		else:
			print("\nInvalid choice entered.")
Ejemplo n.º 8
0
def start_chat():
    current_status_message=None
    friend_count=0

    #displaying menu of spy_chat
    while True:
        print('\nMENU\n1. Add Status\n2. Add Friend\n3. Send Message\n4. Read Message\n5. Close\n')

        #input choice
        menu_choice=int(raw_input('Select Options from Menu\n'))
        if menu_choice==1:
            spy.current_status_message=AS.add_status(spy.current_status_message)
            print('UPDATED STATUS MESSAGE : %s\n'%(spy.current_status_message))
        elif menu_choice==2:
            friend_count=SF.add_friend()
            print('No. Of Friends You have : %d\n'%(friend_count))
        elif menu_choice==3:
            SF.send_message()
        elif menu_choice==4:
            SF.read_message()
        elif menu_choice==5:
            break
        else:
            print('\nPlease enter a valid choice\n')