Skip to content

Commit

Permalink
move typing to def
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Sep 4, 2024
1 parent 0e46a4f commit e265d50
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions spinn_utilities/make_tools/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import os
import sys
from typing import Optional

from .file_converter import FileConverter
from .log_sqllite_database import LogSqlLiteDatabase

Expand All @@ -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.
"""
Expand All @@ -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.
Expand All @@ -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):
Expand Down

0 comments on commit e265d50

Please sign in to comment.