mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-07-01 14:40:00 +02:00
🐛 cli_line_dirs: Type-annotate functions
This commit is contained in:
parent
68344e48f8
commit
9414a92f9f
1 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
from typing import Iterator, Tuple
|
from typing import Callable, Iterator, Optional, Tuple
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
@ -29,7 +29,9 @@ def is_hidden(filepath):
|
||||||
return filename.startswith(".")
|
return filename.startswith(".")
|
||||||
|
|
||||||
|
|
||||||
def find_all_files(dir_: str, pred: Callable[[str], bool]=None, return_hidden: bool=False) -> Iterator[str]:
|
def find_all_files(
|
||||||
|
dir_: str, pred: Optional[Callable[[str], bool]] = None, return_hidden: bool = False
|
||||||
|
) -> Iterator[str]:
|
||||||
"""
|
"""
|
||||||
Find all files in dir_, returning filenames
|
Find all files in dir_, returning filenames
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ def common_suffix(its):
|
||||||
|
|
||||||
|
|
||||||
def find_gt_and_ocr_files(
|
def find_gt_and_ocr_files(
|
||||||
gt_dir, gt_suffix, ocr_dir, ocr_suffix
|
gt_dir: str, gt_suffix: str, ocr_dir: str, ocr_suffix: str
|
||||||
) -> Iterator[Tuple[str, str]]:
|
) -> Iterator[Tuple[str, str]]:
|
||||||
"""
|
"""
|
||||||
Find GT files and matching OCR files.
|
Find GT files and matching OCR files.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue