Ejemplo n.º 1
0
	def test_copy_email(self):
		'''
		Test to confirm that we are copying the email address from a found contact
		'''
		self.new_contact.save_contact()
		Contact.copy_email("0714832401")
		self.assertEqual(self.new_contact.email,pyperclip.paste())
Ejemplo n.º 2
0
 def test_copy_email(self):
     """
     Test to confirm that we are copying the email address from a found contact
     """
     self.new_contact.save_contact()
     Contact.copy_email("0712345678")
     self.assertEqual(self.new_contact.email, pyperclip.paste())
Ejemplo n.º 3
0
    def test_copy_email(self):

        # test to confirm we are copying the email address from a found contact
        self.new_contact.save_contact()
        Contact.copy_email("072012131")

        self.assertEqual(self.new_contact.email, pyperclip.paste())
Ejemplo n.º 4
0
    def test_copy_email(self):
        self.new_contact.save_contact()
        Contact.copy_email("0728868073")

        self.assertEqual(self.new_contact.email,pyperclip.paste())

            if _name_ == '_main_':
                unittest.main()
Ejemplo n.º 5
0
def main():
    user_name = input(
        "Hello, welcome to your contact list. What is your name? ")

    print(f"Hello {user_name}. What would you like to do?")
    print('\n')

    while True:
        print(
            "Use these short codes: \n cc - create a new contact \n dc - display contacts \n fc - find a contact \n ex - exit the contact list app \n del - delete a contact \n cpc - copy a contact email"
        )

        short_code = input().lower()

        if short_code == 'cc':
            print('New Contact')
            print('-' * 10)

            f_name = input('First name...:')

            l_name = input('Last name...:')

            p_number = input('Phone number...:')

            e_address = input('Email address...: ')

            save_contact(
                create_contact(f_name, l_name, p_number,
                               e_address))  #create and save new contact
            print('\n')
            print(f'New contact {f_name} {l_name} created')
            print('\n')

        elif short_code == 'dc':

            if display_contacts():
                print('Here is a list of all your contacts')
                print('\n')

                for contact in display_contacts():
                    print(
                        f'{contact.first_name} {contact.last_name} ......{contact.number}'
                    )

                print('\n')
            else:
                print('\n')
                print('You don\'t seem to have any contact saved yet')
                print('\n')

        elif short_code == 'fc':

            search_number = input('Enter the number you want to search for: ')

            if check_existing_contacts(search_number):
                search_contact = find_contact(search_number)
                print(
                    f'{search_contact.first_name} {search_contact.last_name}')
                print('-' * 20)

                print(
                    f'Phone number......: {search_contact.phone_number} \n Email address......: {search_contact.email}'
                )

            else:
                print('That contact does not exist')

        elif short_code == 'del':

            search_number = input('Enter the number you want to delete: ')

            if check_existing_contacts(search_number):
                search_contact = find_contact(search_number)
                print(
                    f'{search_contact.first_name} {search_contact.last_name}')
                print('-' * 20)

                del_contact(search_contact)
                print('Your contact has been deleted')

            else:
                print('That contact does not exist')

        elif short_code == 'cpc':

            search_number = input('Enter the number you want to copy: ')

            if check_existing_contacts(search_number):
                search_contact = find_contact(search_number)
                print(
                    f'{search_contact.first_name} {search_contact.last_name}')
                print('-' * 20)

                Contact.copy_email(search_number)
                print('\n Your contact has been copied. \n')

        elif short_code == 'ex':
            print('Bye..... It was fun while it lasted.... :-)')
            break

        else:
            print('I really didn\'t get that. Please use the short codes')
Ejemplo n.º 6
0
def copy_email(number):
    '''
    Function that returns copied email
    '''
    return Contact.copy_email(number)
Ejemplo n.º 7
0
def copy_mail():
    return Contact.copy_email(Contact)    
Ejemplo n.º 8
0
def copy_email(number):
    return Contact.copy_email(number)
Ejemplo n.º 9
0
def copy_email(email):
    return Contact.copy_email(email)
Ejemplo n.º 10
0
 def test_copy_email(self):
     self.new_contact.save_contact()
     Contact.copy_email("3153806748")
     self.assertEqual(self.new_contact.email, pyperclip.paste())
Ejemplo n.º 11
0
def copy_clipboard(number):
    return Contact.copy_email(number)
Ejemplo n.º 12
0
def copy_email():
    '''
    Function that returns all the saved contacts
    '''
    return Contact.copy_email()
Ejemplo n.º 13
0
def copy_email():
    '''
    Function that copies email to clipboard
    '''
    return Contact.copy_email()
Ejemplo n.º 14
0
def copy_email(number):
    '''
    function that finds email using number 
    '''
    return Contact.copy_email(number)
Ejemplo n.º 15
0
    def test_copy_email(self):

        self.new_contact.save_contact()
        Contact.copy_email("0712345678")

        self.assertEqual(self.new_contact.email, pyperclip.paste())
Ejemplo n.º 16
0
def copy_email(number):
    '''
    Function that copies email from a contact
    '''
    return Contact.copy_email(number)
Ejemplo n.º 17
0
def copy_email(number):
    '''
    Function that enables copying of emails to the clipboard
    '''
    return Contact.copy_email(number)
Ejemplo n.º 18
0
def copy_the_email(number):
    '''
    function that copies the email to the clipboard
    '''
    return Contact.copy_email(number)
Ejemplo n.º 19
0
def copy_email(number):
    '''
    Method that handles the behavior of copying the email to the clipboard
    '''
    return Contact.copy_email(number)