From 7dba6a7564296509b079729965ed6d55ab841deb Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 12 Dec 2024 15:19:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20cli=5Fline=5Fdirs:=20Type-annota?= =?UTF-8?q?te=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dinglehopper/cli_line_dirs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dinglehopper/cli_line_dirs.py b/src/dinglehopper/cli_line_dirs.py index 9e806a1..2cd4fe6 100644 --- a/src/dinglehopper/cli_line_dirs.py +++ b/src/dinglehopper/cli_line_dirs.py @@ -1,6 +1,6 @@ import itertools import os -from typing import Iterator, Tuple +from typing import Callable, Iterator, Optional, Tuple import click from jinja2 import Environment, FileSystemLoader @@ -29,7 +29,9 @@ def is_hidden(filepath): 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 @@ -60,7 +62,7 @@ def common_suffix(its): 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]]: """ Find GT files and matching OCR files.