def bucket_lister(bucket, prefix='', delimiter='', marker='', headers=None):
    """
    A generator function for listing keys in a bucket.
    """
    more_results = True
    k = None
    while more_results:
        rs = bucket.get_all_keys(prefix=prefix, marker=marker,
                                 delimiter=delimiter, headers=headers)
        for k in rs:
            yield k
        if k:
            marker = rs.next_marker or k.name
        more_results= rs.is_truncated