Delete an entry in a BibTeX file.

    :param filename: The name of the BibTeX file to edit.
    :param identifier: The id of the entry to delete, in the BibTeX file.

def delete(filename, identifier):
    """
    Delete an entry in a BibTeX file.

    :param filename: The name of the BibTeX file to edit.
    :param identifier: The id of the entry to delete, in the BibTeX file.
    """
    # Get current bibtex
    with open(filename, 'r') as fh:
        bibtex = bibtexparser.load(fh)

    # Delete the bibtex entry
    # TODO: Not working
    try:
        del bibtex.entries_dict[identifier]
    except KeyError:
        pass

    # Write the resulting BibTeX
    write(filename, bibtex)