コード例 #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())
コード例 #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())
コード例 #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())
コード例 #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()
コード例 #5
0
ファイル: run.py プロジェクト: newtonkiragu/contact-list
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')
コード例 #6
0
ファイル: run.py プロジェクト: Akumucollins/Contact_List
def copy_email(number):
    '''
    Function that returns copied email
    '''
    return Contact.copy_email(number)
コード例 #7
0
def copy_mail():
    return Contact.copy_email(Contact)    
コード例 #8
0
def copy_email(number):
    return Contact.copy_email(number)
コード例 #9
0
def copy_email(email):
    return Contact.copy_email(email)
コード例 #10
0
 def test_copy_email(self):
     self.new_contact.save_contact()
     Contact.copy_email("3153806748")
     self.assertEqual(self.new_contact.email, pyperclip.paste())
コード例 #11
0
ファイル: run.py プロジェクト: msanden/contact-list
def copy_clipboard(number):
    return Contact.copy_email(number)
コード例 #12
0
ファイル: run.py プロジェクト: cherucole/python-Intro-task
def copy_email():
    '''
    Function that returns all the saved contacts
    '''
    return Contact.copy_email()
コード例 #13
0
def copy_email():
    '''
    Function that copies email to clipboard
    '''
    return Contact.copy_email()
コード例 #14
0
ファイル: run.py プロジェクト: dan-jugz/conact
def copy_email(number):
    '''
    function that finds email using number 
    '''
    return Contact.copy_email(number)
コード例 #15
0
    def test_copy_email(self):

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

        self.assertEqual(self.new_contact.email, pyperclip.paste())
コード例 #16
0
def copy_email(number):
    '''
    Function that copies email from a contact
    '''
    return Contact.copy_email(number)
コード例 #17
0
ファイル: run.py プロジェクト: lizKimita/Contact-List
def copy_email(number):
    '''
    Function that enables copying of emails to the clipboard
    '''
    return Contact.copy_email(number)
コード例 #18
0
def copy_the_email(number):
    '''
    function that copies the email to the clipboard
    '''
    return Contact.copy_email(number)
コード例 #19
0
ファイル: run.py プロジェクト: isnakolah/Contact-List
def copy_email(number):
    '''
    Method that handles the behavior of copying the email to the clipboard
    '''
    return Contact.copy_email(number)