Remove all entries from a queue

def queuedb_removeall(path, entries):
    """
    Remove all entries from a queue
    """
    db = queuedb_open(path)
    if db is None:
        raise Exception("Failed to open %s" % path)

    cursor = db.cursor()
    queuedb_query_execute(cursor, 'BEGIN', ())

    for entry in entries:
        queuedb_remove(path, entry, cur=cursor)

    queuedb_query_execute(cursor, 'END', ())
    db.commit()
    db.close()

    return True