From e265d5067cd72f142203847b3d729a79990be9e4 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 4 Sep 2024 09:52:03 +0100 Subject: [PATCH] move typing to def --- spinn_utilities/make_tools/converter.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/spinn_utilities/make_tools/converter.py b/spinn_utilities/make_tools/converter.py index 018a0216..e3ca8468 100644 --- a/spinn_utilities/make_tools/converter.py +++ b/spinn_utilities/make_tools/converter.py @@ -14,6 +14,8 @@ import os import sys +from typing import Optional + from .file_converter import FileConverter from .log_sqllite_database import LogSqlLiteDatabase @@ -24,13 +26,13 @@ "neural_build.mk", "Makefile.neural_build"]) -def convert(src, dest, new_dict): +def convert(src: str, dest: str, new_dict: bool): """ Converts a whole directory including sub-directories. - :param str src: Full source directory - :param str dest: Full destination directory - :param bool new_dict: + :param src: Full source directory + :param dest: Full destination directory + :param new_dict: Whether we should generate a new dictionary/DB. If not, we add to the existing one. """ @@ -45,7 +47,8 @@ def convert(src, dest, new_dict): _convert_dir(src_path, dest_path) -def _convert_dir(src_path, dest_path, make_directories=False): +def _convert_dir(src_path: str, dest_path: str, + make_directories:Optional[bool]=False): """ Converts a whole directory including sub directories. @@ -70,7 +73,7 @@ def _convert_dir(src_path, dest_path, make_directories=False): print(f"Unexpected file {source}") -def _mkdir(destination): +def _mkdir(destination: str): if not os.path.exists(destination): os.mkdir(destination) if not os.path.exists(destination):