from typing import TextIO

from .factories.base import BaseFactory


def write_tape(ammo_factory: BaseFactory, stream: TextIO, progress: bool = False) -> None:
    for ammo in ammo_factory.generate(progress=progress):
        stream.write(ammo)
        stream.write('\n')
