def get_transfer_indicator(filename, transferred, total, spaces=50):
    """Returns progress indicator for byte stream transfer."""
    if not total:
        return "{}, ?".format(filename)
    transferred = min(transferred, total)
    spaces_filled = int(spaces * transferred / total)
    return "{}, [{}] {}kB".format(
        filename,
        "·" * spaces_filled + " " * (spaces - spaces_filled - 1),
        transferred // 1024,
    )