def main(
    source_file: typer.FileText,
    destination_file: typer.FileTextWrite,
    no_ignore: bool = False,
):
    template = (line.rstrip("\n") for line in source_file)
    ignore_rules = dont_ignore if no_ignore else all_ignore_rules
    file_name = Path(source_file.name).name
    filtered_lines = (TranslationItem(text=line,
                                      source_file=file_name,
                                      line_number=line_number)
                      for line_number, line in enumerate(template, 1)
                      if not ignore_rules(line))
    save_pot(destination_file, filtered_lines)
def create_pot_file(pot_file: typer.FileTextWrite, files: Sequence[Path],
                    join_paragraphs: bool):
    save_pot(
        pot_file,
        extract_translatables(files, join_paragraphs),
    )
def create_pot_file(pot_file: typer.FileTextWrite, files: Sequence[Path]):
    save_pot(
        pot_file,
        extract_translatables(files),
    )
Exemple #4
0
def create_pot_file(pot_file: TextIO, raw_files: Iterator[Path], source_encoding: str):
    save_pot(
        pot_file,
        extract_translatables_from_raws_batch(raw_files, source_encoding),
    )