khard/khard.py
def remove_subcommand(selected_vcard, force):
    """Remove a contact from the addressbook.

    :param selected_vcard: the contact to delete
    :type selected_vcard: carddav_object.CarddavObject
    :param force: delete without confirmation
    :type force: bool
    :returns: None
    :rtype: None

    """
    if not force:
        while True:
            input_string = input(
                "Deleting contact %s from address book %s. Are you sure? "
                "(y/n): " % (selected_vcard, selected_vcard.address_book))
            if input_string.lower() in ["", "n", "q"]:
                print("Canceled")
                sys.exit(0)
            if input_string.lower() == "y":
                break
    selected_vcard.delete_vcard_file()
    print("Contact %s deleted successfully" % selected_vcard.get_full_name())
def remove_subcommand(selected_vcard, force):
    if not force:
        while True:
            input_string = input(
                "Deleting contact %s from address book %s. Are you sure? "
                "(y/n): " % (selected_vcard, selected_vcard.address_book))
            if input_string.lower() in ["", "n", "q"]:
                print("Canceled")
                sys.exit(0)
            if input_string.lower() == "y":
                break
    selected_vcard.delete_vcard_file()
    print("Contact %s deleted successfully" % selected_vcard.get_full_name())
def remove_subcommand ( selected_vcard , force ) : if not force : while True : input_string = input ( "Deleting contact %s from address book %s. Are you sure? " "(y/n): " % ( selected_vcard , selected_vcard . address_book ) ) if input_string . lower ( ) in [ "" , "n" , "q" ] : print ( "Canceled" ) sys . exit ( 0 ) if input_string . lower ( ) == "y" : break selected_vcard . delete_vcard_file ( ) print ( "Contact %s deleted successfully" % selected_vcard . get_full_name ( ) )
Remove a contact from the addressbook.

    :param selected_vcard: the contact to delete
    :type selected_vcard: carddav_object.CarddavObject
    :param force: delete without confirmation
    :type force: bool
    :returns: None
    :rtype: None
Remove a contact from the addressbook .